Why my map changer dosent work? [closed]
im trying to make a map changer that changes a map then teleports a player to it.
i made this code but its broken
01 | local time_between_each_map = 43 |
03 | local w = game.Workspace:GetChildren() |
05 | if w [ i ] .ClassName = = "Message" or w [ i ] .ClassName = = "Hint" then |
11 | local h = Instance.new( "Hint" ) |
12 | local m = Instance.new( "Message" ) |
13 | local maps = game.Lighting.Big:GetChildren() |
15 | repeat h.Text = time.. " seconds left before new map." |
19 | local w = game.Workspace:GetChildren() |
21 | if game.Lighting.Big:findFirstChild(w [ i ] .Name) then |
27 | local pm = maps [ math.random( 1 ,#maps) ] |
31 | m.Text = "New Stage: " ..map.Name |
32 | time = time_between_each_map |
36 | pos = - 127.708 , 35.319 , 159.171 |
41 | local c = game.Players:GetChildren() |
43 | table.insert(dft, c [ i ] .Name) |
49 | local d = math.random( 1 , #dft) |
51 | local m = Instance.new( "Message" , game.Workspace) |
52 | m.Text = "The random player is ... " ..dft [ s ] .. "!" |
55 | local rndm = game.Players:FindFirstChild(dft [ s ] ) |
57 | local Player = rndm.Character |
58 | Player:MoveTo(Vector 3. new( 127.708 , 35.319 , 159.171 )) |
whats wrong with it?