Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script not working for jump delay + jump power Please help and also why?

I need help, I need a script that does a jump delay + jump power script, Credit on the script bellow to @WideSteal321

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if char:WaitForChild("Humanoid")  then
			print("working ok????????????????????????????????????????????????")
		end
		char.Humanoid.Changed:Connect(function(jumppppp)
			if char.Humanoid.Jump == true then
				char.Humanoid.JumpPower = 0
				print(char.Humanoid.JumpPower)
				wait(2.9)
				char.Humanoid.JumpPower = 50
				print(char.Humanoid.JumpPower)
				wait()
			end
		end)
	end)
end)

2 comments

0

ye i made bad script :dab: ur welcome

0

This site is not for requests.

1 answer

You can use UserInputService to detect a jump and StateChanged to tell whether or not you're allowed to jump. To find the delay, subtract now (tick) from the last jump time.

This is a LocalScript in StarterCharacterScripts

local me = game:GetService('Players').LocalPlayer
local character = me.Character
local humanoid = character:WaitForChild("Humanoid")

local uis = game:GetService('UserInputService')

local canjump = false
local last = tick()
local delaytime = 1

humanoid.JumpPower = 0

humanoid.StateChanged:Connect(function(old, new)
	if new == Enum.HumanoidStateType.Landed then 
		-- make sure we're on the floor 
		canjump = true
	elseif new == Enum.HumanoidStateType.Freefall then
		canjump = false
	end
end)

local function jump()
	if tick() - last >= delaytime and canjump then 
		print("do the thing")
		humanoid.JumpPower = 50
		delay(.25, function() humanoid.JumpPower = 0 end)
		last = tick()
	end
end

uis.JumpRequest:Connect(jump)

1 comment

0

He said, this script someone else made for me doesnt work can someone make another :\

This discussion is preserved as it was. New answers, comments, and votes are closed.