generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Jump Restrictions

Previous Thread :: Next Thread 
wetrel is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
Pragmatist is online. Pragmatist
Joined: 17 Oct 2008
Total Posts: 16170
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 is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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
Pragmatist is online. Pragmatist
Joined: 17 Oct 2008
Total Posts: 16170
14 Jun 2014 06:45 PM
It did when I used it in a crouch function
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
14 Jun 2014 06:45 PM
Have fun with that then..
Report Abuse
wetrel is not online. 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
Pragmatist is online. Pragmatist
Joined: 17 Oct 2008
Total Posts: 16170
14 Jun 2014 06:47 PM
print("success")

better get back to scripting hybrid
Report Abuse
EgoMoose is not online. 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
Pragmatist is online. Pragmatist
Joined: 17 Oct 2008
Total Posts: 16170
14 Jun 2014 06:51 PM
that's definitely easier

put that in starterpack or startergui
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
14 Jun 2014 08:45 PM
Just setting .Jump to false never used to work...


What is happening here?!?!
Report Abuse
Vehkter is not online. Vehkter
Joined: 09 Mar 2014
Total Posts: 152
14 Jun 2014 08:52 PM
It works, warspy. Try it.
Report Abuse
DiamondBladee is not online. DiamondBladee
Joined: 24 Feb 2013
Total Posts: 3527
14 Jun 2014 08:52 PM
I know this is in Roblox Battle, which is currently open-sourced.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image