[SOLVED] How do I prevent this from not loading a map?
Asked by
4 years ago Edited 4 years ago
The map load works in studio, but in game... When a map change it changes, but when it change again it stops working and just sends out nothing at all. (This is a script for a friend I'm currently making... Belongs in ServerScriptService)
01 | local maps = game.Lighting.Maps:GetChildren() |
02 | local msg = Instance.new( "Message" ) |
03 | local Death = game.Workspace.Baseplate |
06 | Death.CanCollide = true |
07 | msg.Parent = game.Workspace |
08 | msg.Text = ( "Loading New Map (Same map will occur, I can't prevent that since this randomizes.)" ) |
10 | chosenmap = maps [ math.random( 1 ,#maps) ] |
11 | chosenmap:Clone().Parent = workspace |
13 | Death.CanCollide = false |
14 | for i,v in pairs (game.Players:GetChildren()) do |
16 | v.Character.Torso.CFrame = workspace:FindFirstChild(chosenmap.Name).Spawn.CFrame |
17 | Death.CanCollide = false |
19 | workspace:FindFirstChild(chosenmap.Name):Destroy() |
20 | Death.CanCollide = true |