script:
local rockLocations = game.Workspace.RockLocations:GetChildren() local numLocations = #rockLocations for place = 1, numLocations - 1 do local rockClone = rock:Clone() rockClone.Parent = script.Parent rockClone.Position = rockLocations[place].Position rockLocations[place].Free.Value = false end rock:Destroy()
Try this:
local rock = script.Parent.Rock:Clone() local rockLocations = game.Workspace.RockLocations:GetChildren() local numLocations = #rockLocations rock:Destroy() for place = 1, numLocations - 1 do local rockClone = rock:Clone() rockClone.Parent = script.Parent rockClone.Position = rockLocations[place].Position rockLocations[place].Free.Value = false end
all I've done is cloned the reference rock and used that clone for your rockClone variable. It looked like the code was spawning the rocks at your locations but then deleting them right after, So cloning the reference part makes a fresh/stand-alone copy of the reference part.
Hope this helps! :)