wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 14 Jun 2014 06:38 PM |
How does one implement restrictions on jumping (such as a debounce, or disabled)?
((One does not simply restrict jumping.)) |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 06:41 PM |
| Well you can use a timer and you can check if their jumping, and stop using velocity |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 06:41 PM |
in a script in workspace
game:service("Players").PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(char) if char:FindFirstChild("Humanoid") then char.Humanoid.Changed:connect(function(prop) if prop=="Jump" and char.Humanoid.Jump == true then char.Humanoid.Jump = false end end) end end) end)
or just look on free models? |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 14 Jun 2014 06:44 PM |
| Thanks. And, using a force to keep them on the ground is a terrible idea.. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 06:44 PM |
@prag
Just simply setting Jump to false will not cancel it, as its already in motion. Also instead of .Changed you could use .Jumping |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 06:45 PM |
| It did when I used it in a crouch function |
|
|
| Report Abuse |
|
|
| |
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 14 Jun 2014 06:46 PM |
| Pragmatist's way worked.. I didn't think it would work either, thats actually why I asked before even trying it. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 06:47 PM |
print("success")
better get back to scripting hybrid |
|
|
| Report Abuse |
|
|
EgoMoose
|
  |
| Joined: 04 Feb 2009 |
| Total Posts: 2896 |
|
|
| 14 Jun 2014 06:49 PM |
Similar to Prag's but simplified...
-- LocalScript
local Hum = script.Parent:WaitForChild("Humanoid")
Hum.Changed:connect(function() Hum.Jump = false end) |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 06:51 PM |
that's definitely easier
put that in starterpack or startergui |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 06:53 PM |
Lemme make on minor adjustment...
EgoMoose
Joined: 04 Feb 2009 Total Posts: 2015 Roblox Wiki 06-14-2014 04:49 PM Similar to Prag's but simplified...
-- LocalScript repeat char = script.Parent.Character until char local Hum = char;WaitForChild("Humanoid")
Hum.Changed:connect(function() Hum.Jump = false end)
That never used to work though... |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 14 Jun 2014 06:58 PM |
| Thanks guys, but I already made it a local script.. XD |
|
|
| Report Abuse |
|
|
Vehkter
|
  |
| Joined: 09 Mar 2014 |
| Total Posts: 152 |
|
|
| 14 Jun 2014 07:03 PM |
game:GetService('Players').PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) local debounce, humanoid = false, character:WaitForChild('Humanoid')
humanoid.Jumping:connect(function() if (debounce) then humanoid.Jump = false else debounce = true wait(3) debounce = false end end) end) end) |
|
|
| Report Abuse |
|
|
Vehkter
|
  |
| Joined: 09 Mar 2014 |
| Total Posts: 152 |
|
|
| 14 Jun 2014 07:06 PM |
local debounce, player = false, game:GetService('Players').LocalPlayer local character = player:WaitForChild('Character') local humanoid = character:WaitForChild('Humanoid')
humanoid.Jumping:connect(function() if (debounce) then humanoid.Jump = false else debounce = true wait(3) debounce = false end end) |
|
|
| Report Abuse |
|
|
wetrel
|
  |
| Joined: 19 Jun 2009 |
| Total Posts: 919 |
|
|
| 14 Jun 2014 07:07 PM |
| Are you trying to make it more complicated than need be? |
|
|
| Report Abuse |
|
|
Vehkter
|
  |
| Joined: 09 Mar 2014 |
| Total Posts: 152 |
|
|
| 14 Jun 2014 07:09 PM |
I gave you two scripts. One is for a regular script, and one is for a local script. You can replace the debounce with humanoid.Jump = false, or you can keep the debounce and simply change the time.
You asked, I gave. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 08:45 PM |
Just setting .Jump to false never used to work...
What is happening here?!?! |
|
|
| Report Abuse |
|
|
Vehkter
|
  |
| Joined: 09 Mar 2014 |
| Total Posts: 152 |
|
| |
|
|
| 14 Jun 2014 08:52 PM |
| I know this is in Roblox Battle, which is currently open-sourced. |
|
|
| Report Abuse |
|
|