I wanted to make a spawn system but for some reason the items dont spawn and theres no errors in the output
local Water = workspace:WaitForChild("ItemSpawns").Items:WaitForChild("Water")
local Itemspawns = script.Parent.Parent
local cooldown = 5
local function randomize()
local random = 2 --math.random(2)
if random == 1 then
local spawnpos = Itemspawns:WaitForChild("ItemSpawnIdk")
elseif random == 2 then
local spawnpos = Itemspawns:WaitForChild("ItemSpawnerLemo")
elseif random == 3 then
local spawnpos = Itemspawns:WaitForChild("ItemSpawnYes")
elseif random == 4 then
local spawnpos = Itemspawns:WaitForChild("ItemSpawnNo")
local chance = 2 --math.random(1,6)
if chance < 3 then
local item = 0 -- item = math.random(1,4)
if item == 0 then
local Item = Water:Clone()
print("Cloned the test item")
Item.Parent = workspace
Item.Handle.CFrame = spawnpos.CFrame + CFrame.new(0,0.5,0)
print("Set its position")
end
end
end
task.wait(cooldown)
randomize()
end
randomize()
How can i fix that? Any suggestions or stuff like that would be appreciated