So this is a script inside a part called "HandleGlow", and it makes a door locked sound, and show a GUI with a text label saying: "Its locked". however, when I clicked it, everything worked, the output printed "WORKED!", the sound played, but the GUI didnt show up. Here is the script below. Please help me!
local clickDetector = script.Parent.ClickDetector
--Mouse hover stuff VVVVVVV--
script.Parent.ClickDetector.MouseHoverEnter:Connect(function()
script.Parent.Parent.HandleGlow.Transparency = 0.75
end)
--Mouse Leave stuff VVVVV---
script.Parent.ClickDetector.MouseHoverLeave:Connect(function()
script.Parent.Parent.HandleGlow.Transparency = 1
end)
--Door Stuff VVVVVV--
function onMouseClick()
script.Parent.DoorLocked:Play()
local A = game.StarterGui:FindFirstChild("LockedMessage")
A.Enabled = true
wait(5)
A.Enabled = false
print("WORKED!")
end
clickDetector.MouseClick:connect(onMouseClick)

1 comment
maybe you can do is check first if the GUI is closed or not