soo I'm making a game on roblox called Crystal Simulator and my cloning is cloning in the wrong spot and idk what to do here is my code for the 2nd crystals:
local crystal = workspace.DemoBreakableCrystal2
local parent = script.Parent
local max = script.Parent.max
local min = script.Parent.min
wait()
-- NEW CRYSYTALS POSITIONS HAVE TO BE UPDATED TO MAX AND MIN
-- X - max.pos.x, min.pos.x
-- Y - 5.705
-- Z - min.pos.z, max.pos.z
for i = 1, 50, 1 do
local newCrystel = crystal:Clone()
if newCrystel then
newCrystel.Name = "BreakableCrystal2"
newCrystel.Parent = workspace
newCrystel.Position = Vector3.new(math.random(-900.651, -631.65), 5.705, math.random(-73.166, 187.434))
end
wait()
end
while wait(math.random(1, 5)) do
local newCrystel = crystal:Clone()
if newCrystel then
newCrystel.Name = "BreakableCrystal2"
newCrystel.Parent = workspace
newCrystel.Position = Vector3.new(math.random(-900.651, -631.65), 5.705, math.random(-73.166, 187.434))
end
end
and here is an image on what the frick is happening:
