I've got a small script which randomly selects a map from a selection of 2 models, I'm having trouble removing them once they are in -
local num = math.random(1,2)
local map = game.Lighting:WaitForChild("Map" ..num)
map:clone().Parent = game.Workspace
game.Workspace.map:Remove()
The last line is where I am having an error, as 'map is not an instance of Workspace' which I can only assume is because it is acting as a pointer here rather than the actual instance of the model, how do I remove the model named, for example Map1 or Map2? Which are randomly selected, so I can't hard-code their names in.
Much appreciated any answers!

1 comment
game.Workspace.Map.Parent = nil