|
| 17 May 2016 02:52 PM |
script.Parent.FocusLost:connect(function(enter) if enter and script.Parent.Text:lower() == "color" then print("test") end end)
what's wrong? works in studio, but not in game.. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 17 May 2016 02:59 PM |
| just a question, what do you mean to accomplish by having enter as a parameter? |
|
|
| Report Abuse |
|
|
|
| 17 May 2016 03:00 PM |
If I type "color" inside the textbox, and press enter it should print "test" apparently it works on studio, but not in game. |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 May 2016 03:03 PM |
| nvm, wiki says I should use in local script. |
|
|
| Report Abuse |
|
|
|
| 17 May 2016 03:17 PM |
yes you should use in localscript. all scripts inside GUIs should be local
|
|
|
| Report Abuse |
|
|
|
| 19 May 2016 05:53 AM |
all scripts?
so if I had a normal script with one line that says print("hi") it wont work in online mode? |
|
|
| Report Abuse |
|
|
|
| 19 May 2016 07:47 AM |
It would normally, but that doesn't mean it's a good thing. Roblox is kind of a joke when it comes to client and server behavior, or at least it used to be. It's getting better, and that seems to be the biggest thing that has caused games to break. Anyhow, Guis are client-sided. They should be handled by LocalScripts. Same with keyboard and mouse input. Handle it on the client. Then if you need the server for something, send a signal by RemoteEvent or RemoteFunction. Don't just tell the server "I pressed the 'h' key!", because then you're still mostly doing it on the server. This causes input latency and is improper.
Also if you are using FilteringEnabled (Eliminates the jokiness I mentioned earlier), it is REQUIRED that you use LocalScripts.
|
|
|
| Report Abuse |
|
|