Here is the code:
local function runDropper(dropper) spawn(function() local loopWaitTime = dropper:WaitForChild("LoopWaitTime") local oreValue = dropper:WaitForChild("OreValue") local dropperPart = dropper:WaitForChild("DropperPart") if loopWaitTime and oreValue and dropperPart then local waitTime = loopWaitTime.Value local oreToClone = Instance.new("Part") local loopedTimes = 0 while true do wait(2) local newOre = oreToClone:Clone() newOre.Name = "Ore" newOre.Parent = dropper newOre.Size = Vector3.new(1, 1, 1) newOre.Position = dropperPart.Position game.Debris:AddItem(newOre, 20) local cash = Instance.new("NumberValue") cash.Name = "Cash" cash.Parent = newOre cash.Value = oreValue.Value loopedTimes = loopedTimes + 1 print(loopedTimes) end end end) end return runDropper
when I print loopedTimes it only prints: 1 Could someone tell me what is wrong? I have no idea. Thanks!