sdfgw
|
  |
 |
| 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
|
  |
| 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
|
  |
 |
| 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
|
  |
| 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
|
  |
| 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
|
  |
 |
| 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 |
|
|
|
| 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
|
  |
 |
| 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 |
|
|
|
| 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
|
  |
| Joined: 25 May 2009 |
| Total Posts: 664 |
|
|
| 07 Jul 2009 11:23 AM |
| cut off there legs at the spawn |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2009 11:23 AM |
| @ bob, you cant call character like that >.> |
|
|
| Report Abuse |
|
|
sdfgw
|
  |
 |
| Joined: 08 Jan 2009 |
| Total Posts: 41681 |
|
|
| 07 Jul 2009 11:26 AM |
*snaps fingers*
Nice call Axel. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
 |
| 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
|
  |
 |
| 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 |
|
|
|
| 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
|
  |
 |
| Joined: 08 Jan 2009 |
| Total Posts: 41681 |
|
|
| 07 Jul 2009 12:56 PM |
| :P I thought Jump didn't use Velocity. |
|
|
| Report Abuse |
|
|
| |
|
sdfgw
|
  |
 |
| 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 |
|
|
|
| 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
|
  |
 |
| 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 |
|
|