Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local giveMoney = game.ReplicatedStorage.GiveMoney
- local waitVar = game.ServerStorage.Wait
- local moneyToGive = 5000
- local waitMax = 5
- function moneyFunc(plr)
- if plr:FindFirstChild("leaderstats") then
- plr.leaderstats.Cash.Value += moneyToGive
- end
- end
- giveMoney.OnServerInvoke = function(plr)
- if waitVar.Value <= 0 then
- moneyFunc(plr)
- game.ServerStorage.Wait.Value = waitMax
- return true, "+$"..moneyToGive
- else
- return false, "You must wait "..waitVar.Value.." more seconds."
- end
- end
- while wait() do
- if game.ServerStorage.Wait.Value > 0 then
- game.ServerStorage.Wait.Value -= 1
- wait(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment