bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
|
| 25 May 2013 11:11 AM |
Where is the wiki for this...
I want to make it... so if you press space bar... you go upwards gradually... but if its not held you go down... im not sure how i would do this...
Is this possible? im making an underwater diving type game :3 |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 25 May 2013 11:12 AM |
.KeyDown
Life is an endless nightmare |
|
|
| Report Abuse |
|
|
velibor
|
  |
| Joined: 24 Nov 2009 |
| Total Posts: 1003 |
|
|
| 25 May 2013 11:12 AM |
http://wiki.roblox.com/index.php/KeyUp http://wiki.roblox.com/index.php/KeyDown
|
|
|
| Report Abuse |
|
|
bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
|
| 25 May 2013 11:14 AM |
Is it possible to do without the script being in a tool? Like in a local gui in the player, and if they player presses it? |
|
|
| Report Abuse |
|
|
velibor
|
  |
| Joined: 24 Nov 2009 |
| Total Posts: 1003 |
|
|
| 25 May 2013 11:15 AM |
| http://wiki.roblox.com/index.php/RBX.lua.PlayerMouse_(Object) |
|
|
| Report Abuse |
|
|
bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
| |
|
bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
|
| 25 May 2013 11:21 AM |
game.Players.LocalPlayer:GetMouse().Button2Down:connect(function() print("Button2 down!") end)
How do i change this... so its a key like pressing b...? |
|
|
| Report Abuse |
|
|
velibor
|
  |
| Joined: 24 Nov 2009 |
| Total Posts: 1003 |
|
|
| 25 May 2013 11:31 AM |
Mouse = Game.Players.LocalPlayer:GetMouse()
lastkey = nil Mouse.KeyDown:connect(function(key) if key:lower() == "b" then -- Your Action Mouse.KeyUp:connect(function(upkey) if upkey == lastkey then -- Your action end end) end end)
|
|
|
| Report Abuse |
|
|
bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
| |
|
bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
|
| 25 May 2013 11:44 AM |
Has what i basically needed... Thankies dude :3
I now can make a game... where pressing up will make the charecter float up... and letting go will slowly put him down :3 |
|
|
| Report Abuse |
|
|