- _G.Toggle = true
- local function getTycoon()
- for _, v in pairs(game:GetService("Workspace").Tycoons:GetChildren()) do
- if v.OwnerPointer.Value == game.Players.LocalPlayer then
- return v
- end
- end
- end
- while _G.Toggle do
- -- Makes sure you have a tycoon
- if getTycoon() then
- -- Collect Money
- firetouchinterest(game.Players.LocalPlayer.Character.PrimaryPart, getTycoon().Entities.MoneyCollector.Trigger, 0)
- firetouchinterest(game.Players.LocalPlayer.Character.PrimaryPart, getTycoon().Entities.MoneyCollector.Trigger, 1)
- local Money = getTycoon().Data.Money.Value
- -- Loop Through all of the buttons
- for _, v in pairs(getTycoon().Buttons:GetChildren()) do
- -- Makes sure it isn't a gamepass and you have enough money to buy it
- if v:WaitForChild("Configuration"):FindFirstChild("Cost") and v.Configuration.Cost.Value <= Money then
- -- Buys the button
- firetouchinterest(game.Players.LocalPlayer.Character.PrimaryPart, v.Trigger, 0)
- firetouchinterest(game.Players.LocalPlayer.Character.PrimaryPart, v.Trigger, 1)
- --Subtracts the cost from your money
- Money = Money - v.Configuration.Cost.Value
- end
- end
- end
- wait()
- end