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.
01 | local player = game.Players.LocalPlayer |
02 |
03 | local db = true |
04 | script.Parent.MouseButton 1 Click:Connect( function () |
05 | if db = = true then |
06 | script.Parent.Parent.Parent.Secret.Enabled = true |
07 | wait ( 5 ) |
08 | script.Parent.Parent.Parent.Secret.Enabled = false |
09 | script.Parent.Parent.Parent.Parent.Workspace.Secret:Play() |
10 | script.Parent.Parent.Parent.Parent.Workspace.Music 2 :Stop() |
11 | script.Parent.Parent.Parent.Parent.Workspace.RegMusic:Stop() |
12 | player.Character:MoveTo(Vector 3. new((- 1376 , 18.5 , - 492 )) |
13 | db = false |
14 | else |
15 | script.Parent.Parent.Parent.Secret.TextLabel.Text = "There is no Escape" |