VuIpine
|
  |
| Joined: 25 Jul 2015 |
| Total Posts: 881 |
|
|
| 27 Jul 2017 05:43 PM |
1. FE is on 2. it is localscript
mouse = game.Players:GetMouse()
mouse.MouseButton1Down:Connect(function(key) if key == "r" then print("key = "..key) en end) |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2017 05:44 PM |
try pressing "r" maybe it will help |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2017 05:46 PM |
| you forgot to finish the "end" to the if statement. |
|
|
| Report Abuse |
|
|
nullfeels
|
  |
| Joined: 31 Mar 2017 |
| Total Posts: 1215 |
|
|
| 27 Jul 2017 05:47 PM |
| "mouse = game.Players:GetMouse()" to "mouse = game.Players.LocalPlayer:GetMouse()" |
|
|
| Report Abuse |
|
|
Haggie125
|
  |
| Joined: 02 Apr 2008 |
| Total Posts: 761 |
|
|
| 27 Jul 2017 05:48 PM |
| I don't see your logic. You've got an event that fires when the player presses the left mouse button, where would the key come from? |
|
|
| Report Abuse |
|
|
EataPig98
|
  |
| Joined: 01 Mar 2014 |
| Total Posts: 173 |
|
|
| 27 Jul 2017 05:49 PM |
mouse = game.Players:GetMouse()
mouse.KeyDown:connect(function(key) if (key == "r") then print("key = "..key) end end)
screw roblox updates |
|
|
| Report Abuse |
|
|
VuIpine
|
  |
| Joined: 25 Jul 2015 |
| Total Posts: 881 |
|
| |
|
Haggie125
|
  |
| Joined: 02 Apr 2008 |
| Total Posts: 761 |
|
|
| 27 Jul 2017 05:53 PM |
Use UserInputService it's better
local UIS = game:GetService("UserInputService") UIS.InputBegan:connect(function(Obj, gameProcessedEvent) if Obj.KeyCode == Enum.KeyCode.R then print(tostring(Obj.KeyCode)) end end |
|
|
| Report Abuse |
|
|
VuIpine
|
  |
| Joined: 25 Jul 2015 |
| Total Posts: 881 |
|
|
| 27 Jul 2017 05:54 PM |
| no dummy i want to use what i did |
|
|
| Report Abuse |
|
|
nullfeels
|
  |
| Joined: 31 Mar 2017 |
| Total Posts: 1215 |
|
|
| 27 Jul 2017 05:56 PM |
| Whoa! I don't think anyone is gonna help you with that attitude. |
|
|
| Report Abuse |
|
|
BaiYuni
|
  |
| Joined: 09 Oct 2009 |
| Total Posts: 2861 |
|
|
| 27 Jul 2017 05:58 PM |
mouse = game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function(key) if (key == "r") then print("key = "..key) end end) |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2017 06:03 PM |
KeyDown is deprecated, I suggest using UserInputService.
http://wiki.roblox.com/index.php?title=Keyboard_input_(deprecated) |
|
|
| Report Abuse |
|
|
BaiYuni
|
  |
| Joined: 09 Oct 2009 |
| Total Posts: 2861 |
|
|
| 27 Jul 2017 06:11 PM |
| Yes, obviously it's better to use UserInputService, but OP wants to do it his own way. |
|
|
| Report Abuse |
|
|