How can i call this?

Basically the script clones “Lava” model from replicated storage and puts it in workspace but I’m not sure how to access it

if the model is a variable, then you can access it through there

1 Like

for instance,

local lava = game.ReplicatedStorage.Maps.Lava:Clone()
lava.Parent = game.Workspace
-- you can access it through the variable
1 Like

I have multiple maps with the same spawn name so would something like

local spawns = game.Workspace:GetChildren("MapSpawn") work?

((i would test and see if it works but i messed things up and had to rewrite my code like 5 times already lol)

If you need to get multiple "MapSpawn"s then you will have to make an array and a loop

local spawns = {}
for _, object in ipairs(game.workspace:GetDescendants()) do
    if object.Name == "MapSpawn" then
        table.insert(spawns, object)
    end
end

if you only want one MapSpawn you can use FindFirstChild

local spawn = game.workspace:FindFirstChild("MapSpawn", true)
1 Like