Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 02 Oct 2016 02:30 PM |
| ############################################################################################################################################################################################################################################################################################################################################################################################################################################### |
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 02 Oct 2016 02:31 PM |
.-. heres script
repeat wait() until game.Players.LocalPlayer local f = game.Players.LocalPlayer.PlayerGui.dominusInfo.Frame function onClick() if f.Visible == true then end if f.Visible == false then f.Visible = true end end script.Parent.ClickDetector.MouseClick:connect(onClick)
and game
https://www.roblox.com/games/490932829/My-hangout
|
|
|
| Report Abuse |
|
|
DevDays
|
  |
| Joined: 16 Dec 2015 |
| Total Posts: 112 |
|
|
| 02 Oct 2016 02:37 PM |
On Roblox studio, all assets loads instantly, meanwhile in-game it takes a small fraction of a second to load but it's enough to make your script break.
For example: Let's say i execute a code in a LocalScript, and under the LocalScript i have a IntValue.
--Code print(script.IntValue.Value) --/Code
What will happen: Roblox Studio: It prints out the value, no errors given. Game: It'll give you an error saying that the IntValue is missing, that's beacause the object loaded after you executed the script.
How to avoid that: Give time for the object to load(just add a wait() before the script but in certain cases it's not enough.
The best solution is to use WaitForChild().
kappa |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 02 Oct 2016 02:38 PM |
--server script
script.Parent.ClickDetector.MouseClick:connect(function(player) local info = player.PlayerGui:WaitForChild('DominusInfo') local frame = info:WaitForChild('Frame') frame.Visible = not frame.Visible end)
|
|
|
| Report Abuse |
|
|