Hello!
I’m trying to make islands in my game with randomly generated decorations. What would I put in my script which would select a random model from a folder in ServerStorage and place it into the Workspace?
Here’s my script so far:
function createisland()
local island = game.ServerStorage.Island:Clone()
island.Parent = game.Workspace
island:PivotTo(CFrame.new(math.random(-3750, 3750), math.random(-3750, 3750), math.random(-3750, 3750)))
local function generatedecorations()
local decoration = {game.ServerStorage.Decorations:GetChildren()}
local randomdecor = decoration[math.random(1, #decoration)]
randomdecor.Parent = game.Workspace
randomdecor:PivotTo(island.WorldPivot + Vector3.new(math.random(-125, 125), 0, math.random(-125, 125)))
end
generatedecorations()
end
while true do
createisland()
wait(5)
end
Also, I apologize if I am not concise here. This is my first ever post. If I did something wrong, please tell me!