My code doesn't work

yes

Member
Mar 31, 2024
32
1
1
160
Pronouns
he/she/tank/shine/pronouns
here's the code

function mario_update(m)
if m.action == ACT_DIVE then
set_mario_action(m, ACT_JUMP, 0)
end
end

when I try to dive it doesn't turn into a jump.
 
Are you actually hooking that code? Nothing will run mario_update if you aren't hooking it. To hook the function, simply do this:

hook_event(HOOK_MARIO_UPDATE, mario_update)

HOOK_MARIO_UPDATE is the hook event, this will make it so every time mario updates, your mario_update function runs.
 
I have another problem
Are you actually hooking that code? Nothing will run mario_update if you aren't hooking it. To hook the function, simply do this:

hook_event(HOOK_MARIO_UPDATE, mario_update)

HOOK_MARIO_UPDATE is the hook event, this will make it so every time mario updates, your mario_update function runs.
it doesn't work for other players
 

Users who are viewing this thread