Advertisement
King12255

Roblox HitBox Gui

Nov 30th, 2024 (edited)
7,157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.10 KB | None | 0 0
  1. local ScreenGui = Instance.new("ScreenGui")
  2. local Frame = Instance.new("Frame")
  3. local Num = Instance.new("TextBox")
  4. local Plus = Instance.new("TextButton")
  5. local Minus = Instance.new("TextButton")
  6.  
  7. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  8. ScreenGui.ResetOnSpawn = false
  9.  
  10. Frame.Size = UDim2.new(0, 200, 0, 100)
  11. Frame.Position = UDim2.new(0.5, -100, 0.5, -50)
  12. Frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  13. Frame.Parent = ScreenGui
  14. Frame.Active = true
  15. Frame.Draggable = true
  16.  
  17. Num.Size = UDim2.new(0.6, 0, 0.6, 0)
  18. Num.Position = UDim2.new(0.2, 0, 0.3, 0)
  19. Num.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  20. Num.TextColor3 = Color3.new(1, 1, 1)
  21. Num.TextScaled = true
  22. Num.Font = Enum.Font.SourceSans
  23. Num.Text = "•"
  24. Num.ClearTextOnFocus = true
  25. Num.Parent = Frame
  26.  
  27. Plus.Size = UDim2.new(0.2, 0, 0.6, 0)
  28. Plus.Position = UDim2.new(0.8, 0, 0.3, 0)
  29. Plus.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  30. Plus.TextColor3 = Color3.new(1, 1, 1)
  31. Plus.TextScaled = true
  32. Plus.Font = Enum.Font.SourceSans
  33. Plus.Text = "+"
  34. Plus.Parent = Frame
  35.  
  36. Minus.Size = UDim2.new(0.2, 0, 0.6, 0)
  37. Minus.Position = UDim2.new(0, 0, 0.3, 0)
  38. Minus.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
  39. Minus.TextColor3 = Color3.new(1, 1, 1)
  40. Minus.TextScaled = true
  41. Minus.Font = Enum.Font.SourceSans
  42. Minus.Text = "-"
  43. Minus.Parent = Frame
  44.  
  45. local DefaultSize = 1
  46. local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
  47. local humanoidRootPart = character:WaitForChild("HumanoidRootPart", 10)
  48. if humanoidRootPart then
  49.     DefaultSize = humanoidRootPart.Size.X
  50. end
  51.  
  52. local number = math.floor(DefaultSize)
  53. local function UpdateNum()
  54.     Num.Text = tostring(number)
  55. end
  56.  
  57. local function Config()
  58.     for _, player in next, game:GetService("Players"):GetPlayers() do
  59.         if player.Name ~= game.Players.LocalPlayer.Name then
  60.             pcall(function()
  61.                 local hrp = player.Character.HumanoidRootPart
  62.                 hrp.Size = Vector3.new(_G.HeadSize, _G.HeadSize, _G.HeadSize)
  63.                 hrp.Transparency = 0.4
  64.                 hrp.BrickColor = BrickColor.new("Black")
  65.                 hrp.Material = "Neon"
  66.                 hrp.CanCollide = false
  67.             end)
  68.         end
  69.     end
  70. end
  71.  
  72. local function DefaultConfig()
  73.     for _, player in next, game:GetService("Players"):GetPlayers() do
  74.         if player.Name ~= game.Players.LocalPlayer.Name then
  75.             pcall(function()
  76.                 local hrp = player.Character.HumanoidRootPart
  77.                 hrp.Size = Vector3.new(DefaultSize, DefaultSize, DefaultSize)
  78.                 hrp.Transparency = 1
  79.                 hrp.BrickColor = BrickColor.new("Medium stone grey")
  80.                 hrp.Material = "Plastic"
  81.                 hrp.CanCollide = true
  82.             end)
  83.         end
  84.     end
  85. end
  86.  
  87. local function Credits() game:GetService("StarterGui"):SetCore("SendNotification", {
  88.         Title = "HitBox Gui",
  89.         Text = "Made By the_king.78",
  90.         Duration = 12
  91.     })
  92. end
  93.  
  94. Plus.MouseButton1Click:Connect(function()
  95.     number = number + 1
  96.     UpdateNum()
  97.     _G.HeadSize = number
  98.     Config()
  99. end)
  100.  
  101. Minus.MouseButton1Click:Connect(function()
  102.     if number > 0 then
  103.         number = number - 1
  104.         UpdateNum()
  105.         _G.HeadSize = number
  106.         if number == 0 then
  107.             DefaultConfig()
  108.         else
  109.             Config()
  110.         end
  111.     end
  112. end)
  113.  
  114. Num.FocusLost:Connect(function(enterPressed)
  115.     if enterPressed then
  116.         local Value = tonumber(Num.Text)
  117.         if Value and Value >= 0 then
  118.             number = Value
  119.             UpdateNum()
  120.             _G.HeadSize = number
  121.             if number == 0 then
  122.                 DefaultConfig()
  123.             else
  124.                 Config()
  125.             end
  126.         else
  127.             UpdateNum()
  128.         end
  129.     end
  130. end)
  131.  
  132. _G.HeadSize = DefaultSize
  133. _G.Disabled = true
  134.  
  135. game:GetService("RunService").RenderStepped:Connect(function()
  136.     if _G.Disabled then
  137.         if number > 0 then
  138.             Config()
  139.         else
  140.             DefaultConfig()
  141.         end
  142.     end
  143. end)
  144.  
  145. Credits()
  146. UpdateNum()
Tags: Roblox Script Gui
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement