Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is the gui only working in studio but not in public servers?

Asked by
s1muIate -35
6 years ago

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!

0
Can you provide any information at all? theCJarmy7 1293 — 6y
0
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 s1muIate -35 — 6y
0
Also I have NO errors... s1muIate -35 — 6y
0
Is this a local script? tightanfall 110 — 6y
View all comments (3 more)
0
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. papasherms 168 — 6y
0
You have to say what kind of script it is and where it is located, there's probably a problem with that g1o2r3d4a5n6 350 — 6y
0
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. Zafirua 1348 — 5y

1 answer

Log in to vote
0
Answered by
Zafirua 1348 Badge of Merit Moderation Voter
6 years ago
Edited 5 years ago

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

1) You referenced Server Communications from the Client Communications.

  • Workspace and Lighting are an exception but if you had referenced ServerStorage or ServerScriptService somewhere in your Local Script, it will not work.

2) 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 output Infinite Yield Possible.

3) Always use PlayerGui over anything else.

  • PlayerGui is the Local Player's Gui. Consider changing it to this method rather than using script.Parent because we can't understand what its Parent is. It could be a TextButton, TextLabel, Frame and 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.

4) You used a Server Script for doing all this.

  • You may not use Server Script for this. There is a different between Server Script and Local Script. Server Script is for Server interaction. Server Script is the holder of all the data and uses this to keep the game going smoothly. The Local Script is used for Client interactions.

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.

5) 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.

Ad

Answer this question