Advertisement
C-H-4-0-S

Esp and crosshair

Feb 4th, 2024 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.66 KB | None | 0 0
  1. local FillColor = Color3.fromRGB(175,25,255)
  2. local DepthMode = "AlwaysOnTop"
  3. local FillTransparency = 0.5
  4. local OutlineColor = Color3.fromRGB(255,255,255)
  5. local OutlineTransparency = 0
  6.  
  7. local CoreGui = game:FindService("CoreGui")
  8. local Players = game:FindService("Players")
  9. local lp = Players.LocalPlayer
  10. local connections = {}
  11.  
  12. local Storage = Instance.new("Folder")
  13. Storage.Parent = CoreGui
  14. Storage.Name = "Highlight_Storage"
  15.  
  16. local function Highlight(plr)
  17. local Highlight = Instance.new("Highlight")
  18. Highlight.Name = plr.Name
  19. Highlight.FillColor = FillColor
  20. Highlight.DepthMode = DepthMode
  21. Highlight.FillTransparency = FillTransparency
  22. Highlight.OutlineColor = OutlineColor
  23. Highlight.OutlineTransparency = 0
  24. Highlight.Parent = Storage
  25.  
  26. local plrchar = plr.Character
  27. if plrchar then
  28. Highlight.Adornee = plrchar
  29. end
  30.  
  31. connections[plr] = plr.CharacterAdded:Connect(function(char)
  32. Highlight.Adornee = char
  33. end)
  34. end
  35.  
  36. Players.PlayerAdded:Connect(Highlight)
  37. for i,v in next, Players:GetPlayers() do
  38. Highlight(v)
  39. end
  40.  
  41. Players.PlayerRemoving:Connect(function(plr)
  42. local plrname = plr.Name
  43. if Storage[plrname] then
  44. Storage[plrname]:Destroy()
  45. end
  46. if connections[plr] then
  47. connections[plr]:Disconnect()
  48. end
  49. end)
  50.  
  51. -- Create a ScreenGui to hold our crosshair
  52. local gui = Instance.new("ScreenGui")
  53. gui.Parent = game.Players.LocalPlayer.PlayerGui
  54.  
  55. -- Create a Frame for the horizontal line of the crosshair
  56. local horizontalLine = Instance.new("Frame")
  57. horizontalLine.Size = UDim2.new(0, 20, 0, 2) -- Adjust the size and thickness here
  58. horizontalLine.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- Starting color
  59. horizontalLine.BorderSizePixel = 0
  60. horizontalLine.Parent = gui
  61.  
  62. -- Create a Frame for the vertical line of the crosshair
  63. local verticalLine = Instance.new("Frame")
  64. verticalLine.Size = UDim2.new(0, 2, 0, 20) -- Adjust the size and thickness here
  65. verticalLine.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- Starting color
  66. verticalLine.BorderSizePixel = 0
  67. verticalLine.Parent = gui
  68.  
  69. -- Function to update the crosshair's position
  70. local function updateCrosshairPosition()
  71. local mouse = game.Players.LocalPlayer:GetMouse()
  72. horizontalLine.Position = UDim2.new(0, mouse.X - 10, 0, mouse.Y)
  73. verticalLine.Position = UDim2.new(0, mouse.X, 0, mouse.Y - 10)
  74. end
  75.  
  76. -- Connect the update function to the mouse move event
  77. game:GetService("RunService").RenderStepped:Connect(updateCrosshairPosition)
  78.  
  79. -- Function to update the crosshair's color
  80. local function updateCrosshairColor()
  81. local hue = tick() % 5 / 5 -- Cycle through colors every 5 seconds
  82. horizontalLine.BackgroundColor3 = Color3.fromHSV(hue, 1, 1)
  83. verticalLine.BackgroundColor3 = Color3.fromHSV(hue, 1, 1)
  84. end
  85.  
  86. -- Connect the update function to the heartbeat event
  87. game:GetService("RunService").Heartbeat:Connect(updateCrosshairColor)
  88.  
  89. -- Custom Crosshair by zzerexx#3970
  90. getgenv().CrosshairSettings = {
  91. Color = Color3.fromRGB(255,0,0),
  92. RainbowColor = true,
  93. Opacity = 9,
  94. Length = 10,-- Length of each line
  95. Thickness = 2,-- Thickness of each line
  96. Offset = 4, -- Offset from the middle point
  97. Dot = true, -- not recommended
  98. FollowCursor = false, -- Crosshair follows the cursor
  99. HideMouseIcon = true, -- Hides the mouse icon, set to 0 to ignore
  100. HideGameCrosshair = true, -- Hides the current game's crosshair (if its supported)
  101. ToggleKey = Enum.KeyCode.RightAlt, -- Toggles crosshair visibility
  102. } -- v1.2.1
  103. loadstring(game:HttpGet("https://raw.githubusercontent.com/zzerexx/scripts/main/CustomCrosshair.lua", true))()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement