SnapSan777

esp all

May 21st, 2024
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2. local Players = game:GetService("Players")
  3. local RunService = game:GetService("RunService")
  4. local LP = Players.LocalPlayer
  5. local roles
  6.  
  7. -- > Functions <--
  8.  
  9. function CreateHighlight() -- make any new highlights for new players
  10. for i, v in pairs(Players:GetChildren()) do
  11. if v ~= LP and v.Character and not v.Character:FindFirstChild("Highlight") then
  12. Instance.new("Highlight", v.Character)
  13. end
  14. end
  15. end
  16.  
  17. function UpdateHighlights() -- Get Current Role Colors (messy)
  18. for _, v in pairs(Players:GetChildren()) do
  19. if v ~= LP and v.Character and v.Character:FindFirstChild("Highlight") then
  20. Highlight = v.Character:FindFirstChild("Highlight")
  21. if v.Name == Sheriff and IsAlive(v) then
  22. Highlight.FillColor = Color3.fromRGB(0, 0, 225)
  23. elseif v.Name == Murder and IsAlive(v) then
  24. Highlight.FillColor = Color3.fromRGB(225, 0, 0)
  25. elseif v.Name == Hero and IsAlive(v) and not IsAlive(game.Players[Sheriff]) then
  26. Highlight.FillColor = Color3.fromRGB(255, 250, 0)
  27. else
  28. Highlight.FillColor = Color3.fromRGB(0, 225, 0)
  29. end
  30. end
  31. end
  32. end
  33.  
  34. function IsAlive(Player) -- Simple sexy function
  35. for i, v in pairs(roles) do
  36. if Player.Name == i then
  37. if not v.Killed and not v.Dead then
  38. return true
  39. else
  40. return false
  41. end
  42. end
  43. end
  44. end
  45.  
  46.  
  47. -- > Loops < --
  48.  
  49. RunService.RenderStepped:connect(function()
  50. roles = ReplicatedStorage:FindFirstChild("GetPlayerData", true):InvokeServer()
  51. for i, v in pairs(roles) do
  52. if v.Role == "Murderer" then
  53. Murder = i
  54. elseif v.Role == 'Sheriff'then
  55. Sheriff = i
  56. elseif v.Role == 'Hero'then
  57. Hero = i
  58. end
  59. end
  60. CreateHighlight()
  61. UpdateHighlights()
  62. end)
Advertisement
Add Comment
Please, Sign In to add comment