HowToRoblox

PlayerIndicator

Nov 28th, 2020 (edited)
611
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function indicatePlayers(char)
  2.    
  3.     if not char:FindFirstChild("SelectionBox") then
  4.        
  5.        
  6.         local box = Instance.new("SelectionBox")
  7.  
  8.         box.Color3 = Color3.fromRGB(168, 23, 23)
  9.  
  10.         box.Adornee = char
  11.  
  12.         box.Parent = char
  13.     end
  14. end
  15.  
  16.  
  17. game:GetService("RunService").RenderStepped:Connect(function()
  18.    
  19.     for i, plr in pairs(game.Players:GetPlayers()) do
  20.        
  21.         if plr ~= game.Players.LocalPlayer then
  22.        
  23.             local char = plr.Character or plr.CharacterAdded:Wait()
  24.        
  25.             indicatePlayers(char)
  26.         end
  27.     end
  28. end)
RAW Paste Data