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

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

Asked by 5 years ago
Edited 5 years ago

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

Log in to vote
0
Answered by 5 years ago

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

local player = game:GetService("Players").LocalPlayer
local GUI = player.PlayerGui.Roka
0
The close script is working now but the open one isn't DraconianSG 58 — 5y
0
do the same for the other one megukoo 877 — 5y
0
its a click detector DraconianSG 58 — 5y
0
click detector returns the player, Click.MouseClick:Connect(function(player) player.PlayerGui.GUI.Enabled = true end) SimplifiedCode 227 — 5y
Ad

Answer this question