-
What do you want to achieve? Hey! I’m trying to load maps into my Tower Defense Game.
-
What is the issue? 2 maps in particular are destroyed a few seconds after loading in. Everything works properly up to that point.
-
What solutions have you tried so far? I’ve looked through multiple dev forum posts but none of them have a solution for my problem. I’ve also looked through my own script and can’t find anything that would be causing this.
Here’s the code. There’s 5 different maps currently in the game, “Park”, “Pavement”, “Waterfall”, “Tundra”, and “Candyland.” The last 2 are the ones causing problems. And again, absolutely everything works properly up until either of these two maps load. Please ask if you need any more details!
function waves.LoadMap()
local votedmap = waves.Voting()
local mapfolder = serverstorage.maps:FindFirstChild(votedmap)
if not mapfolder then
mapfolder = serverstorage.maps.Pavement
end
local newmap = mapfolder:Clone()
newmap.Parent = workspace.Map
workspace.Spawnbox.Floor:Destroy()
return newmap
end
Help would be appreciated! I can’t move developing the game until this is fixed.