Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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!

7 comments

0

Can you provide any information at all?

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

0

Also I have NO errors...

0

Is this a local script?

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.

0

You have to say what kind of script it is and where it is located, there's probably a problem with that

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.

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

  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.
  1. 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.
  1. 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.

  1. 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.

  1. 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.