how can i make so when i fall on the ground while using an specific ability i will bounce upwards only a little bit(using the _PLAY_SPRING state)

redhot69

amongus
so im making a mod and trying to make when i fall on the ground i bounce a little bit upwards after using the ability,heres the starting code if anyone is wondering
addHook ("Playerthink", function(player)
if player.mo.skin == "sonic"
if player.cmd.buttons & BT_CUSTOM1
and P_IsObjectOnGround(player.mo)
and (player.mo.state) == S_PLAY_RUN or S_PLAY_WALK or S_PLAY_STND then
P_InstaThrust(player.mo, player.mo.angle, 5*FRACUNIT)
P_SetObjectMomZ(player.mo, 15*FRACUNIT)
player.mo.state = S_PLAY_ROLL
player.pflags = $|PF_SPINNING
end
end
end
end
end)
 
Last edited:
Try changing S_PLAY_ROLL with S_PLAY_SPRING
so im making a mod and trying to make when i fall on the ground i bounce a little bit upwards after using the ability,heres the starting code if anyone is wondering
addHook ("Playerthink", function(player)
if player.mo.skin == "sonic"
if player.cmd.buttons & BT_CUSTOM1
and P_IsObjectOnGround(player.mo)
and (player.mo.state) == S_PLAY_RUN or S_PLAY_WALK or S_PLAY_STND then
P_InstaThrust(player.mo, player.mo.angle, 5*FRACUNIT)
P_SetObjectMomZ(player.mo, 15*FRACUNIT)
player.mo.state = S_PLAY_ROLL
player.pflags = $|PF_SPINNING
end
end
end
end
end)
Also, player.mo.state uses two equals
 
Try changing S_PLAY_ROLL with S_PLAY_SPRING

Also, player.mo.state uses two equals
S_PLAY_ROLL is for to the ability look like sonic is spinning,and player.mo.state only uses 2 equals if its *checking* the states not when *setting* a state
 

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

Back
Top