Local script inside GUI button:
local player = game.Players.LocalPlayer
local mm = require(script.ModuleScript)
local has = script.Has -- Bool Value
has.Value = false
script.Parent.MouseButton1Down:connect(function()
if player.leaderstats.Cash.Value >= script.ModuleScript.Mta.Value then
local Mta = script.ModuleScript.Mta.Value -- How much it cost
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value - Mta
Mta = Mta * 2
script.Parent.Text = 'Hire Bil for $'..Mta
has.Value = true
end
end)
Script inside LocalScript:
local mm = require(script.Parent.ModuleScript)
repeat wait() until script.Parent.Has.Value == true
mm.Bil()
Module script inside LocalScript:
local Cash = {}
function Cash.Bil()
while wait(.5) do
local player = game.Players.LocalPlayer
local mtg = script.Mtg -- how much it gives you per second
player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + mtg.Value
end
end
return Cash
mtg is a IntValue. Any fix for this?

2 comments
This is an extremely strange way to organize this code
It is not a good idea to manage the players leaderstats using a local script.