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

I have made a gui open and close script, Why does it not work?

So I made a Close Gui script and an Open Gui script and both won't work here are the scripts

local GUI = game.StarterGui.Roka
local Button = script.Parent

Button.MouseButton1Click:Connect(function()
	GUI.Enabled = false
end)

local GUI = game.StarterGui.Roka
local Click = script.Parent.ClickDetector

Click.MouseClick:Connect(function()
	GUI.Enabled = true
end)

1 answer

This should be in a local script, but the GUI location should be:

local player = game:GetService("Players").LocalPlayer
local GUI = player.PlayerGui.Roka

4 comments

0

The close script is working now but the open one isn't

0

do the same for the other one

0

its a click detector

0

click detector returns the player, Click.MouseClick:Connect(function(player) player.PlayerGui.GUI.Enabled = true end)

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