Hello, i'm trying to make a customize gui for a model, and I have a click detector in the model The script in the click detector is
script.Parent.MouseClick:Connect(function(plr)
if plr.Name == script.Parent.Parent.Parent.Door.Owner1.Value then
game.Players[plr.Name].PlayerGui.Customize.Enabled = true
end
end)
It opens the gui the first time, however it never opens it again after I close the menu.
Here is the script that holds the close function, if that means anything..
local red = script.Parent.Red
local orange = script.Parent.Orange
local yellow = script.Parent.Yellow
local green = script.Parent.Green
local blue = script.Parent.Blue
local purple = script.Parent.Purple
local pink = script.Parent.Pink
local preview = script.Parent.Preview
local RI = script.Parent.RInput
local GI = script.Parent.GInput
local BI = script.Parent.BInput
local R = 30
local G = 79
local B = 255
RI.Changed:Connect(function()
if not tonumber(RI.Text) then
if RI.Text == nil or "" then
R = 0
preview.BackgroundColor3 = Color3.fromRGB(R, G, B)
preview.BorderColor3 = Color3.fromRGB(R, G, B)
end
else
if tonumber(RI.Text) <= 255 and tonumber(RI.Text) >= 0 then
R = tonumber(RI.Text)
preview.BackgroundColor3 = Color3.fromRGB(R, G, B)
preview.BorderColor3 = Color3.fromRGB(R, G, B)
end
end
end)
GI.Changed:Connect(function()
if not tonumber(GI.Text) then
if GI.Text == nil or "" then
G = 0
preview.BackgroundColor3 = Color3.fromRGB(R, G, B)
preview.BorderColor3 = Color3.fromRGB(R, G, B)
end
else
if tonumber(GI.Text) <= 255 and tonumber(RI.Text) >= 0 then
G = tonumber(GI.Text)
preview.BackgroundColor3 = Color3.fromRGB(R, G, B)
preview.BorderColor3 = Color3.fromRGB(R, G, B)
end
end
end)
BI.Changed:Connect(function()
if not tonumber(BI.Text) then
if BI.Text == nil or "" then
B = 0
preview.BackgroundColor3 = Color3.fromRGB(R, G, B)
preview.BorderColor3 = Color3.fromRGB(R, G, B)
end
else
if tonumber(BI.Text) <= 255 and tonumber(BI.Text) >= 0 then
B = tonumber(BI.Text)
preview.BackgroundColor3 = Color3.fromRGB(R, G, B)
preview.BorderColor3 = Color3.fromRGB(R, G, B)
end
end
end)
script.Parent.Close.MouseButton1Click:Connect(function()
script.Parent.Parent.Enabled = false
end)
preview.BackgroundColor3 = Color3.fromRGB(R, G, B)
preview.BorderColor3 = Color3.fromRGB(R, G, B)
Here is the part that closes it
script.Parent.Close.MouseButton1Click:Connect(function()
script.Parent.Parent.Enabled = false
end)
Any reason this may be happening?

3 comments
Oh wow, that format is hurting my eyes
Fixed it, some of the code blocks weren't formatting correctly
Why don't you set the descendant (the frame or whatever) of the ScreenGui to visible instead of enabling and disabling the ScreenGui itself? Even though it's your choice, you also have other ways of doing it. My recommendation would be to change the visibility of the Frame or the descendant instead of enabling and disabling the ScreenGui itself.