Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local Player = Players.LocalPlayer
  3. local Mouse = Player:GetMouse()
  4.  
  5. local Enabled = false
  6. Mouse.KeyDown:connect(function(key)
  7. key = key:upper()
  8. if key == "X" then
  9. if Enabled then
  10. Enabled = false
  11. print("Disabled")
  12. else
  13. Enabled = true
  14. print("Enabled")
  15. end
  16. end
  17. end)
  18.  
  19. local Hitbox = Instance.new("Part")
  20. Hitbox.Transparency = 0.6
  21. Hitbox.Color = Color3.new(1, 1, 1)
  22. Hitbox.Size = Vector3.new(3, 3, 3)
  23. Hitbox.Material = "SmoothPlastic"
  24. Hitbox.CanCollide = false
  25. Hitbox.Anchored = true
  26.  
  27. local S = Instance.new("SelectionBox", Hitbox)
  28. S.Adornee = Hitbox
  29. S.Transparency = 0.3
  30. S.SurfaceTransparency = 1
  31. S.Color3 = Color3.new(0, 0, 0)
  32. S.LineThickness = 0.05
  33.  
  34. game:GetService("RunService"):BindToRenderStep(tostring(math.random(1, 10000)), 1, function()
  35. if Player and Player.Character then
  36. if Player.Character:findFirstChild("HumanoidRootPart") then
  37. local HRP = Player.Character:findFirstChild("HumanoidRootPart")
  38. Hitbox.CFrame = HRP.CFrame * CFrame.new(0, 0, 0)
  39. end
  40. if Player.PlayerGui.ScreenGui.UI.Target.Visible == false then
  41. Hitbox.Transparency = 1
  42. else
  43. Hitbox.Transparency = 0.6
  44. end
  45. end
  46. end)
  47.  
  48. function c3lerp(a,b,t)
  49. return Color3.new(a.r * (1-t) + (b.r*t),a.g * (1-t) + (b.g*t),a.b * (1-t) + (b.b*t))
  50. end
  51.  
  52. local Rainbow = {
  53. Color3.new(1,0,0);
  54. Color3.new(0,1,0);
  55. Color3.new(0,0,1);
  56. Color3.new(0,1,1);
  57. Color3.new(1,0,1);
  58. Color3.new(1,1,0);
  59. }
  60.  
  61. spawn(function()
  62. while true do
  63. local k=Hitbox.Color
  64. local b=Rainbow[math.random(1,#Rainbow)]
  65. local slow=100
  66. for i=1, slow do
  67. Hitbox.Color=c3lerp(k,b,i/slow)
  68. wait()
  69. end
  70. end
  71. end)
  72.  
  73. GetTarget = function()
  74. local Target = nil
  75. local TargetName = nil
  76. pcall(function()
  77. TargetName = Player.PlayerGui.ScreenGui.UI.Target.TargetText.Text
  78. end)
  79. if TargetName then
  80. if Players:findFirstChild(TargetName) then
  81. Target = Players:findFirstChild(TargetName)
  82. end
  83. end
  84. return Target
  85. end
  86.  
  87. while wait() do
  88. if Enabled then
  89. local Target = GetTarget()
  90. if Target and Target.Character then
  91. Hitbox.Parent = Target.Character
  92. else
  93. Hitbox.Parent = workspace
  94. end
  95. else
  96. Hitbox.Parent = nil
  97. end
  98. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement