Problem with my loop ? Second loop start when player connect
Hi people,
I am actually doing a game with a LobbyServer and a GameServer. In the LobbyServer, there is a looped script. When a player connect to the game, it start loop. But the problem is that when a second player connect, it begin one more time the loop. I tried to correct that with a value which turn true when a player connect and the loop doesn't loop one more time. And now the problem is when a second player connect, the time goes 2 more time faster (it seem like the t = t-1 goes 2 time). Can someone help me ? Thanks for answer :D
Here is the code.
01 | local Looped = game.Workspace.Looped |
03 | local Players = game:GetService( "Players" ) |
04 | Players.PlayerAdded:Connect( function () |
05 | if Looped.Value = = false then |
19 | s.Value = "The experience will start in " ..t.. " second(s)" |
22 | s.Value = "Teleporting players" |
24 | s.Value = "Teleporting players." |
26 | s.Value = "Teleporting players.." |
28 | s.Value = "Teleporting players..." |