How do I make an auto collect cash gamepass for my tycoon?

So I am making a tycoon, and I would like to make a gamepass that upon purchased, will make it so that you do not need to step on the collect cash pad to collect your money, instead, the drops will be collected when they hit the pad at the end of the conveyor. I don’t know how to make this though.

I have tried finding a youtube tutorial on it, but the only one I could find is one that told you how to make it so that the drops will auto collect for everyone, and you don’t need to buy a gamepass.

If anybody could help me out that would be great!

1 Like

Hey there! It’s as simple as increasing the player’s cash value when the drops reach the target, so let’s assume the drops take 5 seconds to reach the target, so every 5 seconds you have to increase the value of the player’s cash.

Now this will be in a script. This script will initially be disabled. (Every script hasa property called disabled set that to true) so upon purchase of the gamepass the script gets enabled.

(Sorry am bad at explaining, feel free to ask any questions!)

1 Like

The issue is, drops have different amounts of cash that are given. If I increased it by only 1 amount, they would not be getting the full amount of cash from drops dropped.

*EDIT: I’m also garbage at scripting so I don’t know how to make that

Possibly some useful developer hub documentation

Do you have any code? If you do, please show us so we can help you further

1 Like

Please excuse me it’s 12am lol, one way could potentially be locating the script of the part that the drops touch to give cash, and edit it so that if the player owns the gamepass then instead of adding it to the cash balance/collector, deposit it straight to the players stats.

(This is assuming you have a bit of scripting knowledge and scripted the tycoon yourself)

Pyxrien.

1 Like

Sure I can give some code, what code do you want to see, the code that handles the droppers or the purchase code. I’m only asking because I have no idea how to do this.

Hey there, you mentioned that the drops are having different cash amounts, so I assume you have already made the drops script, we would be able to further assist you if you could show us the drops script.

You could add a int value inside each drop and then read that and add that value to the players cash.

Show us the droppers code, that would be helpful :+1:

1 Like

image

That is the code inside one of the droppers (Dropper 1)

If you have some kind of cash register, bank, or anything, show us that, maybe you could make auto collect from basic collect script if you know what i mean.

What do you mean by cash register or bank?

Could you format it correctly by using the three backticks (```)

![image|690x373](upload://8pPNSyeRNOuNmLO0b7IFCANbTJy.png)

I did that wrong wait

image

It’s a screenshot thats why it wont work

wait(2)
workspace:WaitForChild(“PartStorage”)

while true do
wait(2)
local part = Instance.new(“Part”,workspace.PartStorage)
part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
part.Material=script.Parent.Parent.Parent.MaterialValue.Value
local cash = Instance.new(“IntValue”,part)
cash.Name = “Cash”
cash.Value = 25
part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)
part.FormFactor = “Custom”
part.Size=Vector3.new(1.2, 1.2, 1.2)
part.TopSurface = “Smooth”
part.BottomSurface = “Smooth”
game.Debris:AddItem(part,20)
end

This is the main script. This will hold the subscript.

wait(2)
workspace:WaitForChild(“PartStorage”)

while true do
wait(2)
local part = Instance.new(“Part”,workspace.PartStorage)
local script = Script.Script
script.Parent = part 
script.Disabled = false
part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
part.Material=script.Parent.Parent.Parent.MaterialValue.Value
local cash = Instance.new(“IntValue”,part)
cash.Name = “Cash”
cash.Value = 25
part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)
part.FormFactor = “Custom”
part.Size=Vector3.new(1.2, 1.2, 1.2)
part.TopSurface = “Smooth”
part.BottomSurface = “Smooth”
game.Debris:AddItem(part,20)
end

We need to make a new script and put it inside this main script. Don’t forget to disable this subscript.

I assume you’ll find a way to get the associated player to the collection box

wait(19.5)
local player = etc -- I'll let you fill this up!
player.leaderstats.Cash.Value += Script.Parent.Cash.Value

Where do I put the gamepass ID so the game knows what gamepass it is?

Like place where you redeem cash