Advertisement
kingmohamed

Hitbox

Jan 19th, 2025 (edited)
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.15 KB | None | 0 0
  1. local Close = Instance.new("TextButton")
  2. local Open2 = Instance.new("ScreenGui")
  3. local Open = Instance.new("TextButton")
  4. local FightingGui = Instance.new("ScreenGui")
  5. local main = Instance.new("Frame")
  6. local Cre = Instance.new("TextLabel")
  7. local HitBox = Instance.new("TextBox")
  8. local Red = Instance.new("TextBox")
  9. local Green = Instance.new("TextBox")
  10. local Blue = Instance.new("TextBox")
  11.  
  12. local UICorner = Instance.new("UICorner")
  13. local UICorner_2 = Instance.new("UICorner")
  14. local UICorner_3 = Instance.new("UICorner")
  15. local UICorner_4 = Instance.new("UICorner")
  16.  
  17. -- Properties
  18. FightingGui.Name = "FightingGui"
  19. FightingGui.Parent = game.CoreGui
  20. FightingGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  21.  
  22. Open2.Name = "Tools"
  23. Open2.Parent = game.CoreGui
  24. Open2.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  25.  
  26. Open.Name = "Open"
  27. Open.Parent = Open2
  28. Open.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  29. Open.Position = UDim2.new(0, 0, 0.451871663, 0)
  30. Open.Size = UDim2.new(0, 50, 0, 50)
  31. Open.Font = Enum.Font.FredokaOne
  32. Open.Text = "Open"
  33. Open.TextColor3 = Color3.fromRGB(250, 0, 0)
  34. Open.TextScaled = true
  35. Open.MouseButton1Down:Connect(function()
  36. FightingGui.Enabled = true
  37. end)
  38.  
  39. Close.Name = "Close"
  40. Close.Parent = main
  41. Close.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  42. Close.Position = UDim2.new(1, 0, -0.001, 0)
  43. Close.Size = UDim2.new(0, 30, 0, 30)
  44. Close.Font = Enum.Font.FredokaOne
  45. Close.Text = "X"
  46. Close.TextColor3 = Color3.fromRGB(0, 0, 0)
  47. Close.TextScaled = true
  48. Close.MouseButton1Down:Connect(function()
  49. FightingGui.Enabled = false
  50. end)
  51.  
  52. UICorner_4.Parent = Close
  53.  
  54. main.Parent = FightingGui
  55. main.Active = true
  56. main.BackgroundColor3 = Color3.fromRGB(42, 42, 42)
  57. main.Position = UDim2.new(0.259, 0, 0.237, 0)
  58. main.Size = UDim2.new(0, 127, 0, 111)
  59. main.Draggable = true
  60.  
  61. UICorner.Parent = main
  62.  
  63. Cre.Name = "Cre"
  64. Cre.Parent = main
  65. Cre.BackgroundColor3 = Color3.fromRGB(34, 34, 34)
  66. Cre.Position = UDim2.new(0, 0, -0.019, 0)
  67. Cre.Size = UDim2.new(0, 127, 0, 16)
  68. Cre.Font = Enum.Font.FredokaOne
  69. Cre.Text = "Script made by WarriorRoberr"
  70. Cre.TextColor3 = Color3.fromRGB(0, 0, 0)
  71. Cre.TextScaled = true
  72.  
  73. UICorner_2.Parent = Cre
  74. UICorner_3.Parent = HitBox
  75.  
  76. HitBox.Name = "HitBox"
  77. HitBox.Parent = main
  78. HitBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  79. HitBox.Position = UDim2.new(0.113, 0, 0.127, 0)
  80. HitBox.Size = UDim2.new(0, 103, 0, 79)
  81. HitBox.Font = Enum.Font.FredokaOne
  82. HitBox.PlaceholderText = "Put Number Here"
  83. HitBox.Text = ""
  84. HitBox.TextColor3 = Color3.fromRGB(0, 0, 0)
  85. HitBox.TextScaled = true
  86.  
  87. game:GetService('RunService').RenderStepped:Connect(function()
  88. for _, player in ipairs(game:GetService('Players'):GetPlayers()) do
  89. if player ~= game.Players.LocalPlayer then
  90. local localPlayerTeam = game.Players.LocalPlayer.Team
  91. local otherPlayerTeam = player.Team
  92.  
  93. -- Apply only to opponents
  94. if otherPlayerTeam ~= localPlayerTeam then
  95. local character = player.Character
  96. if character and character:FindFirstChild("HumanoidRootPart") then
  97. local hrp = character.HumanoidRootPart
  98. hrp.Size = Vector3.new(tonumber(HitBox.Text) or 1, tonumber(HitBox.Text) or 1, tonumber(HitBox.Text) or 1)
  99. hrp.Transparency = 0.9
  100. hrp.Color = Color3.new(
  101. tonumber(Red.Text) or 0,
  102. tonumber(Green.Text) or 0,
  103. tonumber(Blue.Text) or 0
  104. )
  105. hrp.Material = Enum.Material.Neon
  106. hrp.CanCollide = false
  107. end
  108. else
  109. -- Optional reset for teammates
  110. local character = player.Character
  111. if character and character:FindFirstChild("HumanoidRootPart") then
  112. local hrp = character.HumanoidRootPart
  113. hrp.Size = Vector3.new(2, 2, 1) -- Default size
  114. hrp.Transparency = 0
  115. hrp.Material = Enum.Material.Plastic
  116. hrp.CanCollide = true
  117. end
  118. end
  119. end
  120. end
  121. end)
  122.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement