Advertisement
Gggggidkwhyyyy

Roblox money give command /give [ username ] [ quantity ]

Oct 26th, 2024
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.51 KB | Source Code | 0 0
  1. local Players = game:GetService("Players")
  2.  
  3.  
  4. local admins = {
  5.     2902070659,
  6.     3323300897
  7. }
  8.  
  9.  
  10. local function isAdmin(player)
  11.     return table.find(admins, player.UserId) ~= nil
  12. end
  13.  
  14.  
  15. Players.PlayerAdded:Connect(function(player)
  16.     player.Chatted:Connect(function(message)
  17.    
  18.         if message:sub(1, 5) == "/give" then
  19.  
  20.             if isAdmin(player) then
  21.                 local args = message:split(" ")
  22.  
  23.            
  24.                 if #args == 3 then
  25.                     local targetPlayerName = args[2]
  26.                     local amount = tonumber(args[3])
  27.  
  28.                
  29.                     if amount and amount > 0 then
  30.                    
  31.                         local targetPlayer = Players:FindFirstChild(targetPlayerName)
  32.                         if targetPlayer then
  33.                            
  34.                             local leaderstats = targetPlayer:FindFirstChild("leaderstats")
  35.                             local argent = leaderstats and leaderstats:FindFirstChild("Argent")
  36.                             if argent then
  37.                                
  38.                                 argent.Value = argent.Value + amount
  39.                                
  40.                                 player:SendSystemMessage("Tu as donné " .. amount .. " à " .. targetPlayer.Name)
  41.                                 targetPlayer:SendSystemMessage("Tu as reçu " .. amount .. " de " .. player.Name)
  42.                             else
  43.                                 player:SendSystemMessage("Le joueur cible n'a pas de leaderstats.")
  44.                             end
  45.                         else
  46.                             player:SendSystemMessage("Joueur introuvable.")
  47.                         end
  48.                     else
  49.                         player:SendSystemMessage("Montant invalide.")
  50.                     end
  51.                 else
  52.                     player:SendSystemMessage("Utilisation correcte: /give NomDuJoueur Montant")
  53.                 end
  54.             else
  55.                 player:SendSystemMessage("Tu n'es pas autorisé à utiliser cette commande.")
  56.             end
  57.         end
  58.     end)
  59. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement