MarioFreak2001
that one gal
I'm trying to make a Sonic 06 style thok, and I need some help.
Here's the code:
addHook("ThinkFrame", do
for player in players.iterate
if player.mo and player.mo.skin == player.mo.skin
if not (player.mo.thoktimer)
player.mo.thoktimer = 0
end
if player.mo.thoktimer > 0
player.mo.thoktimer = $1 - 1
end
if player.pflags & PF_THOKKED
and (not(player.homing))
and player.powers[pw_super] == 0
//P_InstaThrust(player.mo, player.mo.angle, 50*FRACUNIT)
A_Thrust(player.mo, 50, 1)
local thok = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_THOK)
thok.color = player.mo.color
thok.scale = player.mo.scale
thok.fuse = 3
player.mo.momz = 0
end
end
end
end)
Sonic keeps getting thrusted forward, which is the desired effect, but I want him to stop 1 second after thoking. And I don't know how to do that.
EDIT: Ignore the code not looking right.
EDIT: Also I want him to drop like a rock when the thok ends like in Sonic 06
Here's the code:
addHook("ThinkFrame", do
for player in players.iterate
if player.mo and player.mo.skin == player.mo.skin
if not (player.mo.thoktimer)
player.mo.thoktimer = 0
end
if player.mo.thoktimer > 0
player.mo.thoktimer = $1 - 1
end
if player.pflags & PF_THOKKED
and (not(player.homing))
and player.powers[pw_super] == 0
//P_InstaThrust(player.mo, player.mo.angle, 50*FRACUNIT)
A_Thrust(player.mo, 50, 1)
local thok = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_THOK)
thok.color = player.mo.color
thok.scale = player.mo.scale
thok.fuse = 3
player.mo.momz = 0
end
end
end
end)
Sonic keeps getting thrusted forward, which is the desired effect, but I want him to stop 1 second after thoking. And I don't know how to do that.
EDIT: Ignore the code not looking right.
EDIT: Also I want him to drop like a rock when the thok ends like in Sonic 06
Last edited: