Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local admins = {
- 2902070659,
- 3323300897
- }
- local function isAdmin(player)
- return table.find(admins, player.UserId) ~= nil
- end
- Players.PlayerAdded:Connect(function(player)
- player.Chatted:Connect(function(message)
- if message:sub(1, 5) == "/give" then
- if isAdmin(player) then
- local args = message:split(" ")
- if #args == 3 then
- local targetPlayerName = args[2]
- local amount = tonumber(args[3])
- if amount and amount > 0 then
- local targetPlayer = Players:FindFirstChild(targetPlayerName)
- if targetPlayer then
- local leaderstats = targetPlayer:FindFirstChild("leaderstats")
- local argent = leaderstats and leaderstats:FindFirstChild("Argent")
- if argent then
- argent.Value = argent.Value + amount
- player:SendSystemMessage("Tu as donné " .. amount .. " à " .. targetPlayer.Name)
- targetPlayer:SendSystemMessage("Tu as reçu " .. amount .. " de " .. player.Name)
- else
- player:SendSystemMessage("Le joueur cible n'a pas de leaderstats.")
- end
- else
- player:SendSystemMessage("Joueur introuvable.")
- end
- else
- player:SendSystemMessage("Montant invalide.")
- end
- else
- player:SendSystemMessage("Utilisation correcte: /give NomDuJoueur Montant")
- end
- else
- player:SendSystemMessage("Tu n'es pas autorisé à utiliser cette commande.")
- end
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement