← Back to course
medium ✦ 100 Studs

The Collector Pad

Catch the cash parts with a Touched event and pay their value into the player's Cash stat.

Your dropper is raining cash parts, and each one carries a CashValue riding inside it. But right now that cash just piles up on the floor doing nothing. The collector is the piece that catches it, pays you, and clears it away. This is where the dropper and the leaderstats you already built finally shake hands, and your tycoon starts actually making money.

A collector is a flat pad with a Touched event. When a cash part lands on it, the pad reads the value, adds it to your Cash stat, and destroys the part. Three moves: read, pay, clean up.

local pad = script.Parent

pad.Touched:Connect(function(hit)
  -- hit is the part that touched the pad
  local cashValue = hit:FindFirstChild("CashValue")
  if cashValue then
    -- it really is a cash part, pay out
    player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + cashValue.Value
    hit:Destroy()
  end
end)

Look closely at why FindFirstChild is doing the heavy lifting. A Touched event fires for ANYTHING that touches the pad: a cash part, sure, but also a player’s foot, a stray brick, the floor itself. You only want to pay out for real cash. So you ask, “does the thing that touched me have a CashValue inside it?” If FindFirstChild comes back with the value, it is cash, so you collect. If it comes back nil, you quietly ignore it. That single check is what keeps a player from getting paid for stepping on their own pad.

Then hit:Destroy() removes the cash part for good. That matters for two reasons: it stops cash from piling into a laggy mountain, and it makes sure one cash part pays out exactly once. Destroy it and it can never touch the pad a second time.

Now, who owns this pad? In a real tycoon each plot belongs to a specific player, and you would look that owner up (often from a value stored on the plot) rather than a loose player variable. For your first build it is totally fine to grab the owner however your plot is set up, even hardcode it to yourself while you test. Get the read-pay-destroy loop working first, then make the ownership smart.

Here is the satisfying part: you now have a full money loop. Dropper spawns cash, cash slides to the pad, pad pays your Cash stat and clears the part, and the number on your leaderboard ticks up on its own. That self-running cycle is the beating heart of every tycoon.

Now make it yours: get cash collecting and your Cash climbing, then tune it. Speed up the dropper, raise the CashValue, or add a second dropper feeding the same pad and watch your income stack. Once money flows in on its own, you are ready to build something to spend it on.

Build this in Roblox Studio, then check off each step: