the ai coded this really greatly but im still having ṕroblems

redhot69

amongus
addHook("PlayerThink", function(p)
if p.mo.skin == "sonic" -- Only apply to Sonic
if (p.cmd.buttons & BT_CUSTOM1) -- if c1 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)

this code loaded normally and o got no errors in game but when i tried using the ability nothing happens no errors no nothing
 
addHook("PlayerThink", function(p)
if p.mo.skin == "sonic" -- Only apply to Sonic
if (p.cmd.buttons & BT_CUSTOM1) -- if c1 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)

this code loaded normally and o got no errors in game but when i tried using the ability nothing happens no errors no nothing
There's a missing end!
Add it together with the others (the end with a ) still being at the end of the hook) and it should be fixed!
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top