Here's the script that is supposed to run first. This one works perfectly fine:
repeat wait() until game.Players.NumPlayers > 0 player = nil for _, v in pairs(game.Players:GetChildren()) do player = v end function onTouched(hit) hit:Destroy() game.Workspace.Winner.Disabled = false player.PlayerGui.ScreenGui.YouBeatTheLevel.Visible = true wait(2.5) script.Parent.Parent.Parent:Destroy() wait(2.5) player.PlayerGui.ScreenGui.YouBeatTheLevel.Visible = false local cloneNextMap = game.ServerStorage.Maps["2"]:clone() cloneNextMap.Parent = game.Workspace end script.Parent.Touched:connect(onTouched)
And then heres the other one that's supposed to run after the other one, this one doesn't work:
wait(5) player = nil for _, v in pairs(game.Players:GetChildren()) do player = v end if game.Workspace.PlayerAttempts == 1 then player.PlayerGui.Attempts.NumberOfAttempts.Visible = true wait(3) player.PlayerGui.Attempts.NumberOfAttempts.Visible = false player.PlayerGui.Attempts.OneAttempt.Visible = true wait(2) player.PlayerGui.Attempts.OneAttempt.Visible = false end game.Workspace.PlayerAttempts.Value = 0 script.Disabled = true
wait(5) player = nil for _, v in pairs(game.Players:GetChildren()) do player = v end if game.Workspace.PlayerAttempts.Value == 1 then --A value is stored in an instance's property "Value", which you need to specify. Adding ".Value" will fix it! ^_^ player.PlayerGui.Attempts.NumberOfAttempts.Visible = true wait(3) player.PlayerGui.Attempts.NumberOfAttempts.Visible = false player.PlayerGui.Attempts.OneAttempt.Visible = true wait(2) player.PlayerGui.Attempts.OneAttempt.Visible = false end game.Workspace.PlayerAttempts.Value = 0 script.Disabled = true
If I helped you, be sure to accept my answer! :D