Here is the code:
if copy.ItemType.Value == "Dropper" then copy.Parent = tycoonBaseplate:FindFirstChild("PurchasedItems") spawn(function() local dropper = copy local loopWaitTime = dropper:WaitForChild("LoopWaitTime") local oreValue = dropper:WaitForChild("OreValue") local dropperPart = dropper:WaitForChild("DropperPart") while wait(loopWaitTime.Value) do local newOre = Instance.new("Part") newOre.Name = "Ore" newOre.Parent = dropper newOre.Size = dropperPart.Size newOre.Position = dropperPart.Position game.Debris:AddItem(newOre, 25) local cash = Instance.new("NumberValue") cash.Name = "Cash" cash.Parent = newOre cash.Value = oreValue.Value end end)
Your module script will never get to the return line so the could will block at the while loop.
Example:-
-- script print('start') print(require(script.ModuleScript)) print('done') -- module while wait(1) do print('a') end return true -- cannot get to the return
You can use spawn to create a new thread around your while loop.
Example:-
local dropper = script.Parent local loopWaitTime = dropper:WaitForChild("LoopWaitTime") local oreValue = dropper:WaitForChild("OreValue") local dropperPart = dropper:WaitForChild("DropperPart") -- run codeas thread spawn(function() -- you need to think about how you will stop the loop while wait(loopWaitTime.Value) do local newOre = Instance.new("Part") newOre.Name = "Ore" newOre.Parent = dropper newOre.Size = dropperPart.Size newOre.Position = dropperPart.Position game.Debris:AddItem(newOre, 25) local cash = Instance.new("NumberValue") cash.Name = "Cash" cash.Parent = newOre cash.Value = oreValue.Value end end) return true
I hope this helps.
There's either only 1 purchasable item, or it errors somewhere.