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: Disable Jumping?

Previous Thread :: Next Thread 
froggodude is not online. froggodude
Joined: 22 Sep 2012
Total Posts: 1638
19 May 2014 06:52 PM
How can I disable jumping for a character?
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
19 May 2014 06:53 PM
.Changed event on the humanoid and set jump to false.
Report Abuse
Jdad is not online. Jdad
Joined: 12 Jan 2009
Total Posts: 5143
19 May 2014 06:56 PM
Chubbs
Once a jump is in motion it can't be cancelled.

I'd suggest using a bodyforce in the torso to push the body down with just enough force that it counteracts jumping.

Or delete the ROBLOX default character and rescript your own.


[ Karmavore || Legit Threads :: http://www.roblox.com/Forum/ShowPost.aspx?PostID=134583049 ]
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
19 May 2014 07:00 PM
Worked fine for me last time I did it.
Report Abuse
Jdad is not online. Jdad
Joined: 12 Jan 2009
Total Posts: 5143
19 May 2014 07:04 PM
I guarantee it didn't work Chubbs.


[ Karmavore || Legit Threads :: http://www.roblox.com/Forum/ShowPost.aspx?PostID=134583049 ]
Report Abuse
TheLuaUser is not online. TheLuaUser
Joined: 22 May 2012
Total Posts: 1405
20 May 2014 02:11 PM
@Jdad,
It works, proof in No way out which is one of my places...
@OP,
Place this script in Workspace.
___________________________________________
game.Workspace.ChildAdded:connect(function(char)
if char:FindFirstChild("Humanoid") then
script.JumpDisabler:clone().Parent = char
wait(0)
else
return
end
end)
___________________________________________
Place this one in the script above.
Make sure it's a local-script!
Oh and it must be called "JumpDisabler"
___________________________________________
script.Parent:WaitForChild("Humanoid").Changed:connect(function(change)
script.Parent:WaitForChild("Humanoid").Jump = false
wait(0)
end)

Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
20 May 2014 02:24 PM
@above


You could just use PlayerAdded, no LocalScript required.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
20 May 2014 02:24 PM
Not to mention that won't work.
Report Abuse
1MangoMan0 is not online. 1MangoMan0
Joined: 28 Sep 2010
Total Posts: 1596
20 May 2014 02:32 PM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
character.Humanoid.Changed:connect(function()
character.Humanoid.Jump = false
end)
end)
end)

I didn't test this but it should work.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
20 May 2014 02:35 PM
It won't.


Just making Jump false when they make it true don't stop anything.


That would be like if someone enabled a script, so you automatically disabled it. The script will still go through its code.


The jump will still happen
Report Abuse
1MangoMan0 is not online. 1MangoMan0
Joined: 28 Sep 2010
Total Posts: 1596
20 May 2014 02:44 PM
Not true. I have a game that uses this similar code. Your statement is only created by your own theory and you have no evidence to back it up. Setting the jump to false works, unless some Roblox update has recently broken it.
Report Abuse
TheLuaUser is not online. TheLuaUser
Joined: 22 May 2012
Total Posts: 1405
20 May 2014 02:54 PM
@warspy,
PlayerAdded works for a single time.
Respawning won't fire the function.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 May 2014 02:57 PM
p = game.Players.LocalPlayer
repeat wait() until p.Character
c = p.Character
c.Humanoid.Changed:connect(function()
v = c.Torso.Velocity
x,z = v.X,v.Z
c.Torso.Velocity = Vector3.new(x,0,z)
c.Humanoid.Jump = false
end)

works nicely
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
20 May 2014 03:04 PM
Why not put this into a localscript inside StarterGui:

game.Players.LocalPlayer.CharacterAdded:connect(function(char)
while char do
wait() --Not sure if I need the wait here, since the next line waits for Humanoid to be found.
char:WaitForChild("Humanoid").Jump = false
end
end)

Here's my siggy... Done.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
20 May 2014 03:09 PM
Cause it won't work...
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
20 May 2014 03:22 PM
@war Please enlighten me, I'd just like to know why it won't work.

Here's my siggy... Done.
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
20 May 2014 03:24 PM
NVM, ignore me, I found out for myself xD

Here's my siggy... Done.
Report Abuse
Jdad is not online. Jdad
Joined: 12 Jan 2009
Total Posts: 5143
20 May 2014 03:24 PM
Because once it's already in motion it will not stop.

You guys are sad.


[ Karmavore || Legit Threads :: http://www.roblox.com/Forum/ShowPost.aspx?PostID=134583049 ]
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
20 May 2014 03:27 PM
XD I'm surprised they did not know that... They even said they tested it when obviously they never
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
20 May 2014 03:28 PM
@war I never said I tested it... :P
...I need to get my head in gear today, man. XD

Here's my siggy... Done.
Report Abuse
Jdad is not online. Jdad
Joined: 12 Jan 2009
Total Posts: 5143
20 May 2014 03:39 PM
I just added this segment into my character script for my zombie game,

human.Changed:connect(function() -- human is the humanoid var
if human.Jump == true then
human.Jump = false
end
end)

Guess what?

It didn't work.


[ Karmavore || Legit Threads :: http://www.roblox.com/Forum/ShowPost.aspx?PostID=134583049 ]
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