I want to make it so every 10 seconds, it will choose a model from the chances, and spawn it within the plot.
I am using a math.random equation to determine where the part will spawn within the plot boundaries however it turns up the error mentioned in the title at line 23
local plot = game.Workspace:WaitForChild("Plot")
local crystals = game.ReplicatedStorage.Crystals
normal = crystals.BasicCrystal:Clone()
shiny = crystals.ShinyCrystal:Clone()
dm = crystals.DarkMatterCrystal:Clone()
local chances = {
["Normal"] = 1,
["Shiny"] = 2,
["DM"] = 5,
}
local start = 0
local max = 25
while task.wait(10) do
if start == 25 then
return
end
if math.random(1,chances.Normal) then
normal.Parent = game.Workspace.Plot
normal.Posistion = Vector3.new(math.random(-11.75,50.25), math.random(5,5), math.random(-41.75, -109.25))
start += 1
end
end