Anyone know how I would do this? This is my script so far:
local Players = game:GetService("Players") local Prefix = ":" local GroupId = Int Players.PlayerAdded:Connect(function(Player) if Player:GetRankInGroup(GroupId) >= Int then Player.Chatted:Connect(function(msg) if msg:Sub(1,11) == Prefix.."AddPoints " then local Target = Players:FindFirstChild(msg:Sub(12)) end end) end end)
I know this is not in your script, but you could also use a function that allows you to shorten the chatted name of a player in the game. For example: (without function) ;kill KDarren12, (with function) ;kill KD.
function GetPlayer(targetedPlayerName) for _,player in pairs(game:GetService("Players"):GetPlayers()) do if targetedPlayerName:lower() == player.Name:sub(1,targetedPlayerName:len()):lower() then return player end end return nil end local Prefix = ":" local GroupId = Int Players.PlayerAdded:Connect(function(Player) if Player:GetRankInGroup(GroupId) >= Int then Player.Chatted:Connect(function(msg) if msg:Sub(1,11) == Prefix.."AddPoints " then local Target = GetPlayer(msg:sub(12)) -- I do not know if they are leaderstats, but here: print("Added points to player "..Target) end end) end end)