|
| 18 Jan 2016 04:52 PM |
| I'm making a tool that will help you create small regions of water using the Q and E buttons to mark your region. I know that when you're using a local script to use the KeyDown event, you it's an event of the player's mouse, but do I have to use :GetMouse() inside of a tool to actually be able to perform that event? I feel like there might be an event for tools to use keys. Just a question, thanks! |
|
|
| Report Abuse |
|
|
Garfanzo
|
  |
| Joined: 24 Apr 2015 |
| Total Posts: 742 |
|
|
| 18 Jan 2016 04:54 PM |
| :GetMouse() can be used in both local and server scripts, the one thing is that if this is in workspace it should be a server script, unless you turn FE off, but I would stick with a server script. |
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 04:57 PM |
Oh, I guess that I assumed it was limited to local scripts because I used game.Players.LocalPlayer:GetMouse(), right? So instead, perhaps something like:
local mouse
script.Parent.Equipped:connect(function() mouse = game.Players:FindFirstChild(script.Parent.Parent.Name):GetMouse() mouse.KeyDown:connect(function(key) if key == "q" then --script end end) end) |
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 05:01 PM |
| Oh, do I have to disconnect the event inside the unequipped event too? Woops. |
|
|
| Report Abuse |
|
|
Garfanzo
|
  |
| Joined: 24 Apr 2015 |
| Total Posts: 742 |
|
|
| 18 Jan 2016 05:06 PM |
| Something like that should work, lol. |
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 05:06 PM |
both of you deserve to be burned.
jk just use user input service ok
i make u math.sqrt() |
|
|
| Report Abuse |
|
|
Garfanzo
|
  |
| Joined: 24 Apr 2015 |
| Total Posts: 742 |
|
|
| 18 Jan 2016 05:13 PM |
| I have looked into UserImputService, but I cannot figure out how to use it... I'll post a forum about this. |
|
|
| Report Abuse |
|
|