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: Disabing jump.

Previous Thread :: Next Thread 
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
07 Jul 2009 10:24 AM
Uhh I want to be able to disable use of the jump button. No idea how though :/

I have a 2D place, and I made a script that let's you jump upon double pressing w. The only thing is, the script screws up if you jump using space. Any help?
Report Abuse
Bobobob12 is not online. Bobobob12
Joined: 23 Jan 2008
Total Posts: 5350
07 Jul 2009 10:32 AM
Well, how does it screw it up?
Also, is there any way to check if the spacebar is pressed?
(That's just out of curiousity)
Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
07 Jul 2009 10:34 AM
Title fix.

I did a simple onKeyPress function that prints a key you press. A lot of keys come up with strange ASCII characters, but space didn't press anything...
Report Abuse
Person299 is not online. Person299
Joined: 28 Feb 2008
Total Posts: 7952
07 Jul 2009 10:34 AM
I just did it by editing the guy's torso's y velocity when he jumps.
Report Abuse
Bobobob12 is not online. Bobobob12
Joined: 23 Jan 2008
Total Posts: 5350
07 Jul 2009 10:36 AM
Make it so that
if Key==" " then
game.Players.LocalPlayer.Character.Humanoid.Jump=false
end
Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
07 Jul 2009 10:39 AM
Ok, I'll try that. But I didn't think you could interrupt a jump.

@Person: And what method did you use to do that?
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
07 Jul 2009 10:48 AM
You could have a script in another script and the first script inserts the second into a person who joins. Like:
function insert(person)
a = script.Script:Clone()
a.Parent = person
end
game.Workspace:ChildAdded:connect(insert)

and the other could be:

while true do
wait(0.01)
a = script.Parent:findFirstChild("Torso")
if a ~= nil then
a.Velocity = Vector3.new(0, 0, 0)
end
end
Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
07 Jul 2009 10:52 AM
That wouldn't work.. I don't want them to be incapable of going up, just not using the space bar.

Bah, I guess I'll just have to have strict rules -.-
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
07 Jul 2009 11:21 AM
make a body velocity that deactivates when u press ww and reactivates when u touch ground, that way if you try to jump with space, it'll pull u to the ground :D
Report Abuse
314d1 is not online. 314d1
Joined: 25 May 2009
Total Posts: 664
07 Jul 2009 11:23 AM
cut off there legs at the spawn
Report Abuse
iMathRandom is not online. iMathRandom
Joined: 16 Mar 2009
Total Posts: 1847
07 Jul 2009 11:23 AM
@ bob, you cant call character like that >.>
Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
07 Jul 2009 11:26 AM
*snaps fingers*

Nice call Axel.
Report Abuse
verywildnwet is not online. verywildnwet
Joined: 08 Oct 2008
Total Posts: 411
07 Jul 2009 11:35 AM
Hmmmm... i look around my character's animate script.... :/

Nothing worked. I deleted all of my characters jumping part, he still jumped.
Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
07 Jul 2009 11:37 AM
Animate script does nothing. It just makes your arms swing and make it look like you're walking.
Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
07 Jul 2009 12:46 PM
ElectricAxel's idea worked fine xD The only thing is now gravity is mucked up too, but my scripts in my place monitor movement so I can remove the BodyVelocity when you are airborne aswell.
Report Abuse
blobbyblob is not online. blobbyblob
Joined: 29 Oct 2008
Total Posts: 12165
07 Jul 2009 12:54 PM
Try this:

function onJump(player,character)
character.Torso.Velocity=Vector3.new(character.Torso.Velocity.x,0,character.Torso.Velocity.z)
end
function onRespawn(player,character)
character.Humanoid.Jump.Changed:connect(function() onJump(player,character) end)
end
function onPlayerEntered(player)
player.Changed:connect(function(prop) if prop=="Character" then onRespawn(player,player.Character) end end)
end
game.Players.ChildAdded:connect(onPlayerEntered)

Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
07 Jul 2009 12:56 PM
:P I thought Jump didn't use Velocity.
Report Abuse
blobbyblob is not online. blobbyblob
Joined: 29 Oct 2008
Total Posts: 12165
07 Jul 2009 01:00 PM
Of course it does, silly.
Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
07 Jul 2009 01:05 PM
I checked too. I hate it when my Explorer panel blows up in my face -.-
Report Abuse
blobbyblob is not online. blobbyblob
Joined: 29 Oct 2008
Total Posts: 12165
07 Jul 2009 01:09 PM
How did you check? Because if a value changes by an built in script or through physics, it won't show up on the properties menu. If you modify it with a script, it will change on the properties menu.
Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
07 Jul 2009 01:11 PM
I used an adapted version of my Admin Panel (It's slowly taking the Explorer's job) but I guess it still doesn't handle the built in scripts for some reason :/
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