Advertisement
mrfiles404

Donate script

Jul 8th, 2017
4,757
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. player = game.Players.LocalPlayer
  2. currency = "Money"
  3. recipient = ""
  4. amount = 0
  5. script.Parent.MouseButton1Click:Connect(function()
  6.     recipient = script.Parent.Parent.Player.Text
  7.     amount = tonumber(script.Parent.Parent.Amount.Text)
  8.     if player.leaderstats[currency].Value >= tonumber(script.Parent.Parent.Amount.Text) then
  9.         -- Player has enough money to donate
  10.         game.Players[recipient].leaderstats[currency].Value = game.Players[recipient].leaderstats[currency].Value + amount
  11.         player.leaderstats[currency].Value = player.leaderstats[currency].Value - amount
  12.     else
  13.         script.Parent.Text = "You don't have enough cash to donate!"
  14.         wait(2)
  15.         script.Parent.Text = "Click For Send Money"
  16.     end
  17. end)
Advertisement
RAW Paste Data Copied
Advertisement