I’m trying to make a frame appear when as a helping gui when a player presses a clickdetector without a key. My issue is the fact that everything works only I dont want the frame to show when the player has the key, so I made a bool value that changes when a players has the key. Only it doesnt work anymore the bool is set to false and I dont have any errors.
wait(0.05)
local Button = game.Workspace:WaitForChild("PrisonDoor"):WaitForChild("KeyHole")
local Click = Button.Detector.ClickDetector
local Gui = script.Parent.Gradient
Click.MouseClick:Connect(function(player)
if Button.Value == false then
Gui.Visible = true
else
return
end
end)