So i have made a script where it gives a 10 second intermission before everyone is given a sword. Script goes like this:
01 | t = 10 |
02 | repeat |
03 | s.Value = "You will be given a sword in " ..t.. " seconds, stay alive" |
04 | wait( 1 ) |
05 | t = t - 1 |
06 | until t = = 0 |
07 | player = 1 |
08 | local plrs = game.Players:GetChildren() |
09 | repeat |
10 | local clone = game.ServerStorage.ClassicSword:Clone() |
11 | clone.Parent = plrs [ player ] .Backpack |
12 | clone.Script.Disabled = false |
13 | player = player + 1 |
14 | until player = = #ingame |
15 | end |
The line it errors on is line 11.
Anyone got a fix for this?
01 | local serverStorage = game:GetService( "ServerStoage" ) |
02 | local players = game:GetService( "Players" ) |
03 |
04 | local swordTool = serverStorage.ClassicSword |
05 |
06 | local intermissionTime = 10 |
07 |
08 | for secondsLeft = intermissionTime, 1 , - 1 do |
09 | local secondFormat = (secondsLeft > 1 and "seconds" or "second" ) |
10 | s.Value = "You will receive your sword in " ..secondsLeft.. ' ' ..secondFormat.. "; stay alive!" |
11 | end |
12 |
13 | for _,player in pairs (players:GetPlayers()) do |
14 | local sword = swordTool:Clone() |
15 | sword.Script.Disabled = false |
16 | sword.Parent = player.Backpack |
17 | end |