Advertisement
HomelessMage

playerlist.lua

Oct 3rd, 2023
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. Hook.Add("chatMessage", "playerslist", function(msg, client)
  2.     if msg ~= "!players" then return end
  3.     if bit32.band(client.Permissions, 0x40) == 0x40 then
  4.         local msg = ""
  5.         -- you have to loop through Client.ClientList do find the client that is controlling the character, or use Util.FindClientCharacter(character)
  6.         -- Loop through alive players
  7.         for player in Client.ClientList do
  8.             if player.Character.IsHuman then
  9.                     msg = msg .. "\n" .. "[Alive]: " .. player.Character.Name .. "\n" .. "[Nickname]: " .. player.Name .. "\n" ..  "[SteamID]: " .. player.SteamID .."\n"
  10.             end
  11.         end
  12.         -- Now loop through dead ones
  13.         for character in Character.CharacterList do
  14.             if character.IsHuman and character.IsDead and not character.IsBot then
  15.                 msg = msg .. "\n" .. "[Dead]: " .. character.Name .. "\n"
  16.             end
  17.         end
  18.  
  19.         print(msg)
  20.  
  21.         return true
  22.     end
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement