I was creating a system when you click a brick, a GUI will pop up. (Local)
My current script I have is:
This was put in a ClickDetector in a Brick In LocalScript
script.Parent.MouseClick:Connect(function() game.Players.LocalPlayer.PlayerGui.IFE.Frame.Visible = true end)
IFE is the name of the ScreenGui
Hello. LocalScripts does not work in Workspace
and they should be put in StarterPlayerScripts
, StarterCharacterScripts
, StarterGui
, ReplicatedStorage
etc...
Use a Script
with the MouseClick
event. The first argument will be the player who clicked. Just change the Visible property on the server. Here is a toggle Script, every time you click, the Frame will be toggled.
script.Parent.ClickDetector.MouseClick:Connect(function(player) game.Players:FindFirstChild(player.Name):WaitForChild("PlayerGui").IFE.Frame.Visible = not game.Players:FindFirstChild(player.Name):WaitForChild("PlayerGui").IFE.Frame.Visible end)
What is not?
not
changes the boolean value of the property Visible.
For example:
print(not true) --> Prints false
print(not false) --> Prints true