local iron = game.ReplicatedStorage.IronOre local stone = game.ReplicatedStorage.StoneOre local ores = 0 function RandomGen() while ores <= 20 do local newmodel = iron:Clone() local newmodel2 = stone:Clone() newmodel:MoveTo(Vector3.new(math.random(-247, 248), 2.52, math.random(-249, 249))) ores = ores + 1 wait (.3) end end
I am not very good with scripting but I'm trying to make it so that a ore will randomly spawn somewhere within the map.
You didn't call the function, so your code will never run. RandomGen()
.
Also, you never give the iron a parent, so it will just be nil. newmodel.Parent = workspace
Other than that, it looks right, although of course you never use the stone.