JUMP THOK but it flings you down

Then do it?

If you need help, state so and describe what do you need help with.
Just making a statement that you're going to make something, or that you're trying to make something, does not leave much for the imagination.
 
Untitled.png

Post automatically merged:

it is what I want to make
Post automatically merged:

is there a way to make the positive values of the jump part to go down
 
There definitely is a way more efficient way to do this but I'm not sure how but here is the code and it works fine. (Give your character the CA_THOK ability instead of CA_JUMPTHOK)
Downward Thok:
addHook("PlayerThink", function(player) -- runs once per player each frame
    if player.mo.skin ~= "sonic" then --change sonic to your character's name
        return
    end -- this part checks if the player is playing as a certain character and if not, it doesn't do the rest of the script
   
    if player.justthokked == nil then
        player.justthokked = false
    end --this creates a new field within the player
   
    if (player.pflags & PF_THOKKED)
    and player.justthokked == false then
    player.mo.momz = -15*FRACUNIT
    player.justthokked = true
    end --this part checks if the player used their ability and then sends them down
   
    if player.justthokked == true then
    player.mo.momz = $ - 1*FRACUNIT/2
    end --this adds gravity because i had no idea how to add real gravity
   
    if not (player.pflags & PF_THOKKED) then
    player.justthokked = false
    end --this makes sure that the gravity doesn't get added unless an ability is used
end)
 
Last edited:

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

Back
Top