hi i was making this game with my friend and i was working on this secret button i made this script but it doesnt function like it is supposed to i mean it only shows the first gui thats all but its supposed to show that then wait 5 seconds and teleport u into a black room and turn on a secret song and if u try press it again it will show a dark message but doesnt work can u tell me what i did wrong? heres the link idk how to paste code here https://pastebin.com/9Tcg9Cp7
You can put in code using the Lua symbol at the top with all the formatting options.
local player = game.Players.LocalPlayer local db = true script.Parent.MouseButton1Click:Connect(function() if db == true then script.Parent.Parent.Parent.Secret.Enabled = true wait (5) script.Parent.Parent.Parent.Secret.Enabled = false script.Parent.Parent.Parent.Parent.Workspace.Secret:Play() script.Parent.Parent.Parent.Parent.Workspace.Music2:Stop() script.Parent.Parent.Parent.Parent.Workspace.RegMusic:Stop() player.Character:MoveTo(Vector3.new((-1376, 18.5, -492)) db = false else script.Parent.Parent.Parent.Secret.TextLabel.Text = "There is no Escape" script.Parent.Parent.Parent.Secret.TextLabel.BackgroundColor3 = Color3.fromRGB(0,0,0) script.Parent.Parent.Parent.Secret.Enabled = true wait (5) script.Parent.Parent.Parent.Secret.TextLabel.Text = "helo der hou r u?????????///" script.Parent.Parent.Parent.Secret.TextLabel.BackgroundColor3 = Color3.fromRGB(255,255,255) script.Parent.Parent.Parent.Secret.Enabled = false wait(5) game.Players.LocalPlayer.Character.Humanoid.Died:connect(function() db = true end) end end)