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! :)
1 comment
please fix your code formatting, when editing your text, click lua and put your code in between those lines