DanOnScripts

ESP mm2

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