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

How to make a humanoid action pervented for 3 seconds?

local Player = game:GetService('Players').LocalPlayer 
repeat wait() until Player.Character 
local Character = Player.Character 
local Humanoid = Character:WaitForChild("Humanoid")  
Humanoid.Changed:connect(function() 
Humanoid.Jump = false 
end) 

So I know how to make jumping for a humanoid false, but how do you make it where they can jump every 3 seconds? Thanks a bunch!

1 answer

✓ Accepted answer

You have three options. The first is to simply set the WalkSpeed to 0.

humanoid.WalkSpeed = 0

The disadvantage to this is that the player will still be able to jump and turn in first person or mouselock.

The second option is to anchor the torso. However, if the player is jumping or falling when this happens, it will make the character float.

character.Torso.Anchored = true

The third way can only be used in LocalScripts, but it is probably the most effective (depending on what your purposes are). You use the ControllerService to remove a player's control over their character.

local controllerService = game:GetService("ControllerService")
local controller = controllerService:GetChildren()[1]
controller.Parent = nil
--You can restore control by setting it's parent back to ControllerService.

2 comments

0

so where you put it next to jump = false?

0

These are just methods used to disable control of your character, as stated in the original question. It will not help you create a three second jump script.

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