For some reason my model doesn't clone on line 11, v is a model called "1". Thanks!
local levels = game.ServerStorage.Levels:GetChildren()
local selectedlevel = math.random(1,#levels)
local debounce = true
print(selectedlevel)
script.Parent.Touched:Connect(function()
if debounce == true then
for i, v in pairs(levels) do
if v.Name == tostring(selectedlevel) then
v:Clone().Parent = game.Workspace
v:SetPrimaryPartCFrame(CFrame.new(script.Parent.Position) + CFrame.new(15,0,0))
end
end
end
end)

1 comment
I am trying to clone it from server storage to workspace, I don't want 2 clones