redhot69
amongus
addHook("PlayerThink", function(p)
if p.mo.skin == "sonic" then return end -- Only apply to Sonic
if (p.cmd.buttons & BT_JUMP) -- if jump is pressed
and (p.mo.state == S_PLAY_JUMP) -- ensure Sonic is in jump state
then
p.mo.state = S_PLAY_SPRING
S_StartSound(p.mo, sfx_s3k75)
local boost = 5 * FRACUNIT
local upwardBoost = 6 * FRACUNIT
local angle = p.mo.angle
p.mo.momx = p.mo.momx + FixedMul(boost, cos(angle))
p.mo.momy = p.mo.momy + FixedMul(boost, sin(angle))
p.mo.momz = p.mo.momz + upwardBoost
end
end)
if p.mo.skin == "sonic" then return end -- Only apply to Sonic
if (p.cmd.buttons & BT_JUMP) -- if jump is pressed
and (p.mo.state == S_PLAY_JUMP) -- ensure Sonic is in jump state
then
p.mo.state = S_PLAY_SPRING
S_StartSound(p.mo, sfx_s3k75)
local boost = 5 * FRACUNIT
local upwardBoost = 6 * FRACUNIT
local angle = p.mo.angle
p.mo.momx = p.mo.momx + FixedMul(boost, cos(angle))
p.mo.momy = p.mo.momy + FixedMul(boost, sin(angle))
p.mo.momz = p.mo.momz + upwardBoost
end
end)