Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Roblox Update Broke Jump Delay, Any of you can fix it?

Asked by 9 years ago

local TimeBetweenJumps = 2; -- Time in seconds. local Player = game.Players.LocalPlayer repeat wait() until Player.Character ~= nil; local Character = Player.Character --repeat wait() until Character:FindFirstChild("Humanoid") local Humanoid = Character:WaitForChild("Humanoid"); local LastJump = time(); Humanoid.Changed:connect(function() if Humanoid.Jump then if time()-LastJump >= TimeBetweenJumps then LastJump = time(); else Humanoid.Jump = false; end end end)

This was working for 3 months now but awhile ago It broke and can't jump anymore.... Any of you can fix it?

0
Shouldn't time() be wait()? woodengop 1134 — 9y
0
tick(), I think, not wait(), nor time(). BlueTaslem 18071 — 9y
0
I've tried tick() still It doesn't work. DarkSymmetric 0 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

I needed to add repeat wait() until game.Players.LocalPlayer in the 2nd line, but outside of that the script worked for me as is.

@the comments of the question (I cannot comment): tick() and time() can both work here, though they will give slightly different behaviour when the place is having trouble keeping up to the demands of scripts. tick() gives "number of seconds since the Unix epoch, January 1st, 1970" while time() gives "the current place time in seconds. Place time only updates during wait() and must be synchronized across network."

In other words, tick() will give a real-time 2 second delay, whereas time() will give an in-game 2 second delay (which might take longer real time if the place is lagging).

Ad

Answer this question