WolfGamesProgrammer

Local Transfer Money Script

Oct 10th, 2023
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | Source Code | 0 0
  1. local Nick = script.Parent.Nick
  2. local Price = script.Parent.Price
  3. local Button = script.Parent.Button
  4. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  5. local TransferEvent = ReplicatedStorage.events.TransferMoney
  6. local Rubles = game.Players.LocalPlayer.leaderstats.Ru
  7.  
  8.  
  9. function TransferingMoney()
  10.     local Money = tonumber(Price.Text)
  11.     if Price.Text == nil then
  12.         Button.Text = "Введите число"
  13.         wait(2)
  14.         Button.Text = "Передать деньги"
  15.     end
  16.     if Rubles.Value < Money then
  17.         Button.Text = "Недостаточно денег"
  18.         wait(2)
  19.         Button.Text = "Передать деньги"
  20.     end
  21.     if Nick.Text == nil then
  22.         Button.Text = "Введите никнейм игрока"
  23.         wait(2)
  24.         Button.Text = "Передать деньги"
  25.     end
  26.     if Rubles.Value >= Money then
  27.         TransferEvent:FireServer(game.Players:FindFirstChild(Nick.Text), Money)
  28.     end
  29.  
  30. end
  31. Button.MouseButton1Click:Connect(TransferingMoney)
Advertisement
Add Comment
Please, Sign In to add comment