Advertisement
qiell

esp made by chatgpt

Jun 27th, 2024
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. -- Function to create a Highlight object if it doesn't exist
  2. local function ensureHighlight(instance)
  3. local highlight = instance:FindFirstChildOfClass("Highlight")
  4. if not highlight then
  5. highlight = Instance.new("Highlight")
  6. highlight.Parent = instance
  7. end
  8. return highlight
  9. end
  10.  
  11. -- Function to update the color of all highlights
  12. local function updateHighlightColors()
  13. local hue = tick() % 5 / 5 -- Change the color over time
  14. local color = Color3.fromHSV(hue, 1, 1) -- Create a rainbow color
  15.  
  16. -- Update player highlights
  17. for _, player in pairs(game.Players:GetPlayers()) do
  18. local character = player.Character
  19. if character then
  20. local highlight = ensureHighlight(character)
  21. highlight.FillColor = color
  22. highlight.OutlineColor = color
  23. end
  24. end
  25.  
  26. -- Update NPC highlights
  27. local npcFolder = game.Workspace:FindFirstChild("NPCs")
  28. if npcFolder then
  29. for _, npc in pairs(npcFolder:GetChildren()) do
  30. if npc:IsA("Model") then
  31. local highlight = ensureHighlight(npc)
  32. highlight.FillColor = color
  33. highlight.OutlineColor = color
  34. end
  35. end
  36. end
  37. end
  38.  
  39. -- Update colors continuously
  40. game:GetService("RunService").RenderStepped:Connect(updateHighlightColors)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement