I have looked it up before, I'm not the best at scripting yet. I'm attempting to make a script when you click the door it says "It's locked." No key or anything, it just says "It's locked." Script I have (From youtube) is this:
function onClick(click) for i,v in pairs (script.Parent:GetChildren()) do if v.ClassName == "ScreenGui" then c = v:Clone() c.Parent = click.PlayerGui end end end script.Parent.ClickDetector.MouseClick:connect(onClick) wait(3) script.Parent.Parent:Destroy()
function onClick(click) for i, v in pairs(script.Parent:GetChildren()) do if v.ClassName == "ScreenGui" then c = v:Clone() c.Parent = click.PlayerGui -- You should use wait() or task.wait() but preferably is using task.wait. task.wait(3) -- The amount of time you have to wait until the ScreenGui deletes. c:Destroy() -- Destroys the GUI. end end end script.Parent.ClickDetector.MouseClick:Connect(onClick) -- Also use :Connect instead of the lowercase version since is deprecated. task.wait(3) script.Parent.Parent:Destroy()