of     1   

MarkusScaro
#141769700Sunday, July 27, 2014 10:39 PM GMT

Hi, a friend of mine made a script that randomly chooses a map for the server. It worked for a while but then broke around a week or two ago. It still works in solo mode but only loads the same map in play mode. Any suggestions/help? maps = game.Lighting.Maps current = Workspace.Current stage = script.Stage _G["Randomize"] = function() local m = maps:GetChildren() local n = m[math.random(1, #m)] local map = n map.Name = "CurrentMap" map.Parent = current current.MapType.Value = map.Type.Value for i,v in pairs(map:getChildren()) do if v.Name == "Barb Spawn" then v.TeamColor = BrickColor.new("Brown") elseif v.Name == "XL Spawn" then v.TeamColor = BrickColor.new("Bright red") elseif v.Name == "Aux Spawn" then v.TeamColor = BrickColor.new("Bright blue") end end end _G["Remove"] = function() for _,v in pairs(game.Players:GetChildren()) do v.Character = nil end end _G["Respawn"] = function() for _,v in pairs(game.Players:GetChildren()) do v:LoadCharacter() end end _G.Randomize()
BothAngles
#141769910Sunday, July 27, 2014 10:41 PM GMT

maps = game.Lighting.Maps current = Workspace.Current stage = script.Stage _G["Randomize"] = function() local m = maps:GetChildren() local n = m[math.random(1, #m)] local map = n;Spawn(wait) map.Name = "CurrentMap" map.Parent = current current.MapType.Value = map.Type.Value for i,v in pairs(map:getChildren()) do if v.Name == "Barb Spawn" then v.TeamColor = BrickColor.new("Brown") elseif v.Name == "XL Spawn" then v.TeamColor = BrickColor.new("Bright red") elseif v.Name == "Aux Spawn" then v.TeamColor = BrickColor.new("Bright blue") end end end _G["Remove"] = function() for _,v in pairs(game.Players:GetChildren()) do v.Character = nil end end _G["Respawn"] = function() for _,v in pairs(game.Players:GetChildren()) do v:LoadCharacter() end end _G.Randomize()
Fluent_Lua
#141769926Sunday, July 27, 2014 10:41 PM GMT

Why are you using global for all the functions, are you calling them in a different script too?
MarkusScaro
#141770129Sunday, July 27, 2014 10:43 PM GMT

Also note that I barely have any knowledge of scripting. A friend of mine made this and he can't diagnose the problem so here I am.
MarkusScaro
#141770231Sunday, July 27, 2014 10:44 PM GMT

The script looks for a value inside the map so it can determine which kind of audio to play.
BothAngles
#141770311Sunday, July 27, 2014 10:45 PM GMT

roblox probably broke something as usual just like they broke tools and cloning
MarkusScaro
#141770595Sunday, July 27, 2014 10:48 PM GMT

Hopefully they fix it soon. Also is there anything different about the script you put down BothAngles?
MarkusScaro
#141791028Monday, July 28, 2014 2:06 AM GMT

Bump in case someone has some helpful advice.
KOTwarrior
#141793146Monday, July 28, 2014 2:24 AM GMT

on the top of the script put : math.randomseed(tick());

    of     1