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: Any way of keeping a player from jumping?

Previous Thread :: Next Thread 
Caludex is not online. Caludex
Joined: 02 Oct 2013
Total Posts: 50
07 Oct 2013 04:39 PM
Without using a BodyForce to hold them down? It seems that there's no gray area with that object. If you don't have enough force holding the player down they can still jump a tiny bit, but having even just the right amount of force to prevent jumps causes the legs to sink into the ground.

Is there any way to prevent the character from jumping at all?
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
07 Oct 2013 04:43 PM
use the .jumped event in humanoid to check when they jump, when they do anchor the torso or something
Report Abuse
9HB is not online. 9HB
Joined: 11 Dec 2012
Total Posts: 2461
07 Oct 2013 04:47 PM
Yeah, there's a way of doing it.

Deadzonezackack has done it, so have many other people.

Personally I'm not sure exactly how they did it, but I'll give it a go.

Right..... I don't have ROBLOX studio because I'm on a laptop which makes it even more difficult. How about a script that when a player presses space, the x axis of the torso stays the same for the duration of a jump. This means the player can still walk around freely and not be stopped walking up hills.

I'm not sure how to detect space pushes, but it's easy to do. Just make it so that x = the x axis of the torso and wait() then set the current x to x and continue that so you can climb gradients.
Report Abuse
Caludex is not online. Caludex
Joined: 02 Oct 2013
Total Posts: 50
07 Oct 2013 04:47 PM
I'll see if I can do that. I also tried this in a LocalScript in a ScreenGui in the PlayerGui but it didn't work when I tried to test it out in play mode, just in build mode.


C = game.Players.LocalPlayer.Character

C.Humanoid.Changed:connect(function()
if C.Humanoid.Jump == true then C.Humanoid.Jump = false end end)
Report Abuse
JoshuaKempfert is not online. JoshuaKempfert
Joined: 16 Feb 2013
Total Posts: 2407
07 Oct 2013 04:54 PM
Deadzonezackzak deleted the humanoid stored inside the character I believe. Correct me if Im wrong.
Report Abuse
Caludex is not online. Caludex
Joined: 02 Oct 2013
Total Posts: 50
07 Oct 2013 04:57 PM
anchoring the player during the jumping event or changed method simply caused the character to jump even higher. and 9hb, i have no idea what you're talking about.

i tried deleting the humanoid and all it did was cause the character to fall over and be completely uncontrollable.
Report Abuse
Caludex is not online. Caludex
Joined: 02 Oct 2013
Total Posts: 50
07 Oct 2013 04:58 PM
You'd think that with all the fancy features roblox has, jumping would be one of the things you could toggle on and off for a game place... :/
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
07 Oct 2013 05:03 PM
of course the player would just fall over when you deleted the humanoid, thats what controls the character. You would have to completely redesign the controls for the humanoid(Other then the default camera controls) it would be relatively easy to do.
Report Abuse
Caludex is not online. Caludex
Joined: 02 Oct 2013
Total Posts: 50
07 Oct 2013 05:11 PM
I'm pretty sure you cannot change the controls over the humanoid. The wiki speaks of events and mmethods which, if I understand them correctly, are built into the basic functionality of roblox. My common sense (though im probably wrong about this) tells me that to change that functionality, I would have to change the roblox files themselves. At least, that what I believe.

Why doesn't roblox just have features to toggle jumping on and off for places?
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
07 Oct 2013 05:30 PM
You wouldn't have to chance roblox core scripts. Once you remove the humanoid, add a gyro to it, always have the gyro pointing the opposite x and z coordinate of the camera to the torso. After this you can use body position, with y force set to 0, using a local script and player:GetMouse() you can get when the player presses w,a,s,d keys. Using the coordinate frame, you can turn these into changes in x,z position of the player. Just update the position of the bodyposition then.

Simple enough way to make you not be able to press space bar, but gets rid of some player items, such as health, walkspeed(easy to change using the script), and other events, such as hats.
Report Abuse
Caludex is not online. Caludex
Joined: 02 Oct 2013
Total Posts: 50
07 Oct 2013 05:39 PM
That sounds easy enough to do, but it seems overly dramatic just to prevent jumping. I guess there's really no other way... unless..

Maybe I should set a script to kill players when they press the spacebar. After dying enough times they might learn to not jump :D
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
07 Oct 2013 05:43 PM
crazyman32 has one, if everything goes hopeless
Report Abuse
Caludex is not online. Caludex
Joined: 02 Oct 2013
Total Posts: 50
07 Oct 2013 05:57 PM
can you link it to me? i cant seem to find it
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
07 Oct 2013 06:11 PM
humanoid.Jumping:connect(function()
humanoid.Jump = false
end)
Report Abuse
coplox is not online. coplox
Joined: 07 Jun 2008
Total Posts: 3252
07 Oct 2013 06:14 PM
If the player jumps, you set their torso velocity to "Vector3.new()". Or something like this.

I wrote it to be in a localscript in the startergui or starterpack.

wait();
local player = game.Players.LocalPlayer;
while not player.Character do
wait();
end;
player.Character.Humanoid.Jumping:connect(function()
local torso = player.Character.Torso;
print(torso.Velocity)
end);

It does not stop jumping, but it makes it more realistic.. (The height of your leg.)
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
07 Oct 2013 06:15 PM
Take a look at mine. :|
Report Abuse
coplox is not online. coplox
Joined: 07 Jun 2008
Total Posts: 3252
07 Oct 2013 06:16 PM
Er whoops.

wait();
local player = game.Players.LocalPlayer;
while not player.Character do
wait();
end;
player.Character.Humanoid.Jumping:connect(function()
local torso = player.Character.Torso;
torso.Velocity = Vector3.new(torso.Velocity.x, 0, torso.Velocity.z);
end);
Report Abuse
coplox is not online. coplox
Joined: 07 Jun 2008
Total Posts: 3252
07 Oct 2013 06:19 PM
stephen, yours does not work, sorry. Mine does, I tested it.
Report Abuse
stephen1182 is not online. stephen1182
Joined: 31 Aug 2010
Total Posts: 4003
07 Oct 2013 06:19 PM
I tested mine.
Report Abuse
coplox is not online. coplox
Joined: 07 Jun 2008
Total Posts: 3252
07 Oct 2013 06:23 PM
I tested yours too, it does not work.
Report Abuse
Caludex is not online. Caludex
Joined: 02 Oct 2013
Total Posts: 50
07 Oct 2013 06:31 PM
i modofied it a bit by adding a cframing subtraction

wait();
local player = game.Players.LocalPlayer;
while not player.Character do
wait();
end;
player.Character.Humanoid.Jumping:connect(function()
local torso = player.Character.Torso;
torso.Velocity = Vector3.new(torso.Velocity.x, 0, torso.Velocity.z);
torso.CFrame = torso.CFrame - Vector3.new(0, 2, 0)
end);


its close, but id still prefer no jumping at all T_T
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
07 Oct 2013 06:45 PM
http://www.roblox.com/Disable-Character-Jump-item?id=120326227

http://www.roblox.com/My/Groups.aspx?gid=66545
Report Abuse
coplox is not online. coplox
Joined: 07 Jun 2008
Total Posts: 3252
07 Oct 2013 06:45 PM
I'm really sorry, but it's just not possible with the current Humanoid Instance, for now we have to hack around it.

Remember this: The Humanoid is very, very, very stubborn. You have to work really hard to get it to do what you want, which is why people resort to creating their own character controllers.
Report Abuse
coplox is not online. coplox
Joined: 07 Jun 2008
Total Posts: 3252
07 Oct 2013 06:51 PM
Oh right, .Changed fires way before .Jumped does. I forgot.

Yeah, crazyman32's one works well.
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
07 Oct 2013 07:02 PM
:)

http://www.roblox.com/My/Groups.aspx?gid=66545
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