dr_rai
|
  |
| Joined: 26 Oct 2015 |
| Total Posts: 69 |
|
|
| 04 Apr 2016 11:49 AM |
script.KeyDown:connect(function(key)
if key == "q" then script.Parent.Parent.StarterGui.ToolsGui.Building.Visible = true else script.Parent.Parent.StarterGuo.ToolsGui.Building.Visible = false end end dr_rai the docter |
|
|
| Report Abuse |
|
|
dr_rai
|
  |
| Joined: 26 Oct 2015 |
| Total Posts: 69 |
|
|
| 04 Apr 2016 11:50 AM |
Plus, this local script is NOT inside a tool but inside the StarterPack. dr_rai the docter |
|
|
| Report Abuse |
|
|
dr_rai
|
  |
| Joined: 26 Oct 2015 |
| Total Posts: 69 |
|
| |
|
|
| 04 Apr 2016 11:52 AM |
script.KeyDown:connect(function(key)
if key == "q" then script.Parent.Parent.StarterGui.ToolsGui.Building.Visible = true else script.Parent.Parent.StarterGuo.ToolsGui.Building.Visible = false end end)
dr_rai the docter |
|
|
| Report Abuse |
|
|
dr_rai
|
  |
| Joined: 26 Oct 2015 |
| Total Posts: 69 |
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 04 Apr 2016 12:21 PM |
@dire your method is deprecated.
@OP Use UIS
|
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 04 Apr 2016 12:52 PM |
Its not about "if it works"
Its about the correct way to do it.
|
|
|
| Report Abuse |
|
|
|
| 04 Apr 2016 01:03 PM |
| No, it's not about the correct way to do it. It's about getting stuff to work. If it's stupid and it works then it ain't stupid. Also, if OP were to use UserInputService, they'd just spend a bunch of time learning something new, instead of getting their thing to work. There's a time for getting things to work and a time for being a perfectionist. |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2016 01:23 PM |
Deprecated use User Input Service I didnt want to use uis at first either because when i was learning to script i was taught the keyDown method(uis wasnt there yet) but once i switched to uis i realized that it is much more efficient and you can detect keypresses of way more keys with much less effort
~sharpchain1 Leader of Domini Studios |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2016 01:24 PM |
o and @dire we will see what works when roblox finaly removes KeyDown()
~sharpchain1 Leader of Domini Studios |
|
|
| Report Abuse |
|
|
dr_rai
|
  |
| Joined: 26 Oct 2015 |
| Total Posts: 69 |
|
|
| 04 Apr 2016 01:46 PM |
How the hell did we end up from Key Press scripts into this.
|
|
|
| Report Abuse |
|
|
|
| 04 Apr 2016 01:48 PM |
| UserInputService isn't better. It's more object oriented, which Roblox likes to follow, but in real application, its a bunch of bleh because at the end of the line, you have all this code that is put into more and more functions and more and more functions that it gets down to being called by one function. |
|
|
| Report Abuse |
|
|