I need help with cloning

I am building a game, with ores. Now I want the ores to be cloned, but they don’t show in Explorer and the map. Can anybody help?

Heres the cloning part:

while wait(5) do
local y = GetRarities(ore)
print(ore)
if ore == “IronOre” then
cloneIron = IronOre:Clone()
cloneIron.Parent = game.Workspace
local randomX = math.random(-27.625, 143.125)
local randomZ = math.random(55.125, 224.875)
cloneIron.Invis.Anchored = false
cloneIron.Parto.Anchored = false
cloneIron.Partp.Anchored = false
cloneIron.Partq.Anchored = false
cloneIron.Partr.Anchored = false
local neededPos = Vector3.new(randomX,-17.971,randomZ)
cloneIron:MoveTo(neededPos)
else
print(“Dang, you are sure lucky!”)
end
end

Thanks again

Sincerely, PuzzledAbsurdity

Where is the IronOre object you are cloning from created?

Is CanCollide set on the ore parts? If not then the above is going to cause them all to fall out of the bottom of the map.

Few things:

  1. What print statements are you getting in the output?

  2. This isnt going to stop your ore from cloning but will help you down the road: Rather than set many parts to unanchor, you should have all the ore parts unanchored already and weld constraint them to your main ore part that is anchored… this will also be your Primary Part which the MoveTo function uses… then you just unanchor that one primary part when you want it to fall.

  3. Lastly you define variable y in the beginning and then never reference it again… how are you calling on this ore to clone it?

oh my god please format this post my eyes are tearing themselveso ut

1 Like

Hi! If you are still stumbling across this page, I found an answer in another post.