Advertisement
RoScripter

Add Point Script

Nov 28th, 2020 (edited)
6,892
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. local GroupId = 1234567 --REPLACE 1234567 WITH YOUR GROUP ID
  2. local MinimumRankToUseCommand = 255 --REPLACE 255 WITH THE MINIMUM RANK ID TO USE THE !ADDPOINT COMMAND
  3.  
  4. game.Players.PlayerAdded:Connect(function(Player)
  5.     if Player:GetRankInGroup(GroupId) >= MinimumRankToUseCommand then
  6.         Player.Chatted:Connect(function(Message)
  7.             local Words = string.split(Message, " ")
  8.  
  9.             if Words[1] == "!addpoint" then
  10.                 local NameOfPlayerToGivePoint = Words[2]
  11.                 local AmountOfPointsToGive = Words[3]
  12.                
  13.                 local PlayerToGivePoint = game.Players:FindFirstChild(NameOfPlayerToGivePoint)
  14.                
  15.                 if PlayerToGivePoint then
  16.                     PlayerToGivePoint.leaderstats.Points.Value = PlayerToGivePoint.leaderstats.Points.Value + AmountOfPointsToGive
  17.                 end
  18.             end
  19.         end)
  20.     end
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement