and its only Spawning from 1 location
local Table = {}
local Values = script.Parent:FindFirstChild('Values')
local DropperFolder = script.Parent:FindFirstChild('DropperParts')
local MainItems = script.Parent:FindFirstChild('MainItems')
local BoughtItems = script.Parent:FindFirstChild('BoughtItems')
local Buttons = script.Parent:FindFirstChild('Buttons')
local Lava = MainItems.CashCollection.Lava
local CashValues = Values.CashValue
function OnSpawn()
local parts = script.Parent.DropperParts:GetChildren()
for _, part in pairs(parts) do
if part:IsA("BasePart") then
part.Touched:Connect(function(hit)
if hit == Lava then
local cash = part:FindFirstChild("CashValue")
if cash then
CashValues.Value = CashValues.Value + cash.Value
end
part:Destroy()
end
end)
end
end
end
function Table:DropParts(CashValue)
for _, model in pairs(BoughtItems:GetChildren()) do
if model:IsA('Model') and (model.Name == "Dropper" or model.Name == "Dropper1") then
local Pos = model:FindFirstChild("Pos")
if Pos then
local Siz = Pos.Size
while true do
task.wait(2)
local newPart = Instance.new('Part',DropperFolder)
newPart.Position = Pos.Position
newPart.Size = Siz
local Cash = Instance.new('NumberValue',newPart)
Cash.Name = 'CashValue'
Cash.Value = CashValue
end
end
end
end
end
Lava.Touched:Connect(OnSpawn)
return Table``` this is the Module that i did to Drop Parts if Bought Items is true
** You are now Level 1! **