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

How Do You Make A ClickDetector GUI Frame?

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

1 comment

0

What is the question again? Can you specify? Is it script related?

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.