-- SERVICES --

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")

local LAST_PAY = 0
local LAST_RAISE = tick()
local HAS_TO_PAY = 25

local Root = script.Parent

Root.PayRent.OnServerEvent:Connect(function(p)
	if tick() - LAST_PAY > 60 then
		p.leaderstats.Money.Value += HAS_TO_PAY
		LAST_PAY = tick()
	end
end)

Root.RaiseRent.OnServerEvent:Connect(function(p)
	if tick() - LAST_RAISE > 60 then
		HAS_TO_PAY += 5
		LAST_PAY = tick()
	end
end)
