help pls

redhot69

amongus
addHook("ThinkFrame", function()
if player.mo.skin == "sonic"
if (player.cmd.buttons & BT_CUSTOM1)
and not P_IsObjectOnGround(player.mo)
and (player.mo.state == S_PLAY_JUMP) then
P_SetObjectMomZ(player.mo, (10*player.jumpfactor), true)
S_StartSound(player.mo , sfx_bsdj)
player.mo.state = S_PLAY_SPRING
else
player.mo.state = S_PLAY_FALL
end
end)

unexpected symbol near " )"
 
no, put one more end before 'end)' (sorry im not on my pc rn to test if it works)
 
this is the right code (im on my pc now):
Lua:
addHook("PlayerThink", function(player)
    if player.mo.skin == "sonic"
        if (player.cmd.buttons & BT_CUSTOM1)
        and not P_IsObjectOnGround(player.mo)
            if (player.pflags & PF_JUMPED)
                P_SetObjectMomZ(player.mo, (10*player.jumpfactor), true)
                // S_StartSound(player.mo , sfx_bsdj) <- the sound does not exist for some reason
                if (player.mo.state ~= S_PLAY_SPRING)
                    player.mo.state = S_PLAY_SPRING
                end
            end
        end
    end
end)
Post automatically merged:

ty i made it working
no problem, i posted the working code in the same moment you posted this post lol
 
ill give you credits (ill post it)
btw no need to send the full code i already made it working also changed the sound
 

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

Back
Top