Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made by Masteralan --
- --[[
- This script allows the player to perform triple jumps
- by jumping consecutively, 3 times in a row. The player's
- jump height will increase by adding velocity, wich is easy
- to edit.
- You can customize this script to have as many jumps as you
- want, but it will take a little work.
- I might make animation compatibility later, but for now, enjoy!
- --]]
- local plr = game.Players.LocalPlayer --Finds player
- local char = game.Workspace:WaitForChild(plr.Name) --Waits for character to spawn in
- local hum = char:WaitForChild("Humanoid") --Waits for humanoid to load in
- local sound = Instance.new("Sound")
- sound.SoundId = 'http://www.roblox.com/asset/?id=158309736' --Waits for script to load "JumpSound"
- stage = 0
- jumping = false
- falling = false
- -- Jumps --
- function onJump(val)
- jumping = val
- print(stage)
- if jumping == true and stage > 1 and stage < 3 then
- --print("Triple jump!")
- stage = 3
- char.Torso.Velocity = char.Torso.Velocity + Vector3.new(0, 125, 0)
- sound.Pitch = 1.5
- sound:Play()
- wait(1)
- stage = 0
- elseif jumping == true and stage > 0 and stage < 2 then
- --print("Double jump!")
- stage = 2
- char.Torso.Velocity = char.Torso.Velocity + Vector3.new(0, 85, 0)
- sound.Pitch = 1.25
- sound:Play()
- elseif jumping == true and stage < 1 then
- --print("Normal jump!")
- stage = 1
- sound.Pitch = 1
- sound:Play()
- end
- end
- hum.Jumping:connect(onJump)
- -- Jump Timeout --
- function onFall(val)
- falling = val
- if val == false then --When player lands...
- wait(0.25) --Next jump times out after .2 seconds.
- if stage > 0 and falling == false then
- stage = 0 --Resets jumps.
- end
- end
- end
- hum.FreeFalling:connect(onFall)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement