I need help with this. I cant click the button in a public server but I can in studio. I really need the gui to work for my game!
Why is the gui only working in studio but not in public servers?
1 answer
Why does Graphic User Interface opens in studio and never in game??
A very typical problem.
There are many reasons as to why this might happen.
Server Communications | Client Communications ----------|--------------|---------------- Workspace | Workspace Lighting | Lighting Replicated Storage | Replicated Storage Server Storage | Replicated First Server Script Service | Player Gui | Starter Pack | Starter Player
- You referenced
Server Communicationsfrom theClient Communications.
WorkspaceandLightingare an exception but if you had referencedServerStorageorServerScriptServicesomewhere in yourLocal Script, it will not work.
You are waiting for something that does not even exists.
- Look around your code. If you added
WaitForChild()for something that does not even exist or was removed, you script will halt and outputInfinite Yield Possible.
- Always use
PlayerGuiover anything else.
PlayerGuiis theLocal Player'sGui. Consider changing it to this method rather than usingscript.Parentbecause we can't understand what itsParentis. It could be aTextButton,TextLabel,Frameand etc.
You can reference a player by doing this.
-- [Declaration Section]
local Player = game:GetService("Players").LocalPlayer;
and because the PlayerGui is stored inside the Local Player, we can look for it inside the Player.
-- [Declaration Section]
local Player = game:GetService("Players").LocalPlayer;
local PlayerGui = Player:WaitForChild("PlayerGui");
[Note] WaitForChild() for accessing PlayerGui is crucial.
- You used a
Server Scriptfor doing all this.
- You may not use
Server Scriptfor this. There is a different betweenServer ScriptandLocal Script.Server Scriptis forServerinteraction.Server Scriptis the holder of all the data and uses this to keep the game going smoothly. TheLocal Scriptis used forClientinteractions.
For all the Client Communications I mentioned above, you must be using a Local Script and for all the Server Communications, you must be using Server Script.
- You accidentally disabled the
Script
- No there is nothing to laugh and this does happen a lot. Check and see if you had actually disabled your script.
I suggest you actually put the code in your answer so we can see if it is the code's problem or something else.
Comment below when you have done so or if you have any questions. Have fun debugging.
This discussion is preserved as it was. New answers, comments, and votes are closed.

7 comments
Can you provide any information at all?
So I have a script so that when you click it, it makes a frame visible. I also put a print debug in, but it's not even loading that. Here are the scripts: script.Parent.MouseButton1Click:connect(function() script.Parent.Visible = false script.Parent.Parent.Frame.Visible = true game.StarterGui.RebirthGUI.rebirth.Visible = false print("shop opened") end)______script.Parent.MouseButton1Down:conn
Also I have NO errors...
Is this a local script?
If its not working and your using a LocalScript, look through the script and try to find anything that cannot be used in LocalScripts when FE is on.
You have to say what kind of script it is and where it is located, there's probably a problem with that
If you don't want to see -28 on your reputation point and want it to decrease, mark the question as answered so it decreases.