Bestmmm22

Untitled

Aug 27th, 2025
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.49 KB | None | 0 0
  1. --// Hitbox Script dengan Simple Draggable UI + Minimize + Auto Apply ke Player Baru
  2. local player = game.Players.LocalPlayer
  3. local hitboxEnabled = false
  4. local hitboxSize = 5
  5. local minimized = false
  6. -- Buat ScreenGui
  7. local ScreenGui = Instance.new("ScreenGui")
  8. ScreenGui.Parent = game.CoreGui
  9. -- Buat Frame (UI utama)
  10. local Frame = Instance.new("Frame")
  11. Frame.Parent = ScreenGui
  12. Frame.Size = UDim2.new(0, 200, 0, 120)
  13. Frame.Position = UDim2.new(0.3, 0, 0.3, 0)
  14. Frame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
  15. Frame.BorderSizePixel = 0
  16. Frame.Active = true
  17. Frame.Draggable = true -- Bisa digeser
  18. -- Judul
  19. local Title = Instance.new("TextLabel")
  20. Title.Parent = Frame
  21. Title.Size = UDim2.new(1, -25, 0, 25)
  22. Title.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  23. Title.Text = "Shadow .lol Hitbox"
  24. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  25. Title.Font = Enum.Font.SourceSansBold
  26. Title.TextSize = 16
  27. Title.TextXAlignment = Enum.TextXAlignment.Left
  28. -- Tombol Minimize
  29. local MinimizeBtn = Instance.new("TextButton")
  30. MinimizeBtn.Parent = Frame
  31. MinimizeBtn.Size = UDim2.new(0, 25, 0, 25)
  32. MinimizeBtn.Position = UDim2.new(1, -25, 0, 0)
  33. MinimizeBtn.Text = "–"
  34. MinimizeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
  35. MinimizeBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
  36. MinimizeBtn.Font = Enum.Font.SourceSansBold
  37. MinimizeBtn.TextSize = 18
  38. -- Tombol Toggle
  39. local Toggle = Instance.new("TextButton")
  40. Toggle.Parent = Frame
  41. Toggle.Size = UDim2.new(1, -20, 0, 30)
  42. Toggle.Position = UDim2.new(0, 10, 0, 35)
  43. Toggle.Text = "Enable Hitbox: OFF"
  44. Toggle.TextColor3 = Color3.fromRGB(255, 255, 255)
  45. Toggle.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  46. Toggle.Font = Enum.Font.SourceSans
  47. Toggle.TextSize = 16
  48. -- Slider sederhana (pakai TextBox)
  49. local SizeBox = Instance.new("TextBox")
  50. SizeBox.Parent = Frame
  51. SizeBox.Size = UDim2.new(1, -20, 0, 30)
  52. SizeBox.Position = UDim2.new(0, 10, 0, 75)
  53. SizeBox.Text = "Hitbox Size: 5"
  54. SizeBox.TextColor3 = Color3.fromRGB(255, 255, 255)
  55. SizeBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  56. SizeBox.Font = Enum.Font.SourceSans
  57. SizeBox.TextSize = 16
  58. -- Fungsi expand hitbox
  59. local function expandHitbox(char)
  60.     if not hitboxEnabled then return end
  61.     local hrp = char:FindFirstChild("HumanoidRootPart")
  62.     if hrp then
  63.         hrp.Size = Vector3.new(hitboxSize, hitboxSize, hitboxSize)
  64.         hrp.Transparency = 0.7
  65.         hrp.BrickColor = BrickColor.new("Bright red")
  66.         hrp.Material = Enum.Material.Neon
  67.         hrp.CanCollide = false
  68.     end
  69. end
  70. -- Toggle hitbox
  71. Toggle.MouseButton1Click:Connect(function()
  72.     hitboxEnabled = not hitboxEnabled
  73.     Toggle.Text = "Enable Hitbox: " .. (hitboxEnabled and "ON" or "OFF")
  74.     for _,plr in pairs(game.Players:GetPlayers()) do
  75.         if plr ~= player and plr.Character then
  76.             expandHitbox(plr.Character)
  77.         end
  78.     end
  79. end)
  80. -- Ubah ukuran via TextBox
  81. SizeBox.FocusLost:Connect(function(enterPressed)
  82.     if enterPressed then
  83.         local val = tonumber(SizeBox.Text:match("%d+"))
  84.         if val then
  85.             hitboxSize = math.clamp(val, 2, 20)
  86.             SizeBox.Text = "Hitbox Size: " .. hitboxSize
  87.             if hitboxEnabled then
  88.                 for _,plr in pairs(game.Players:GetPlayers()) do
  89.                     if plr ~= player and plr.Character then
  90.                         expandHitbox(plr.Character)
  91.                     end
  92.                 end
  93.             end
  94.         else
  95.             SizeBox.Text = "Hitbox Size: " .. hitboxSize
  96.         end
  97.     end
  98. end)
  99. -- Auto apply ke semua player yang join
  100. game.Players.PlayerAdded:Connect(function(plr)
  101.     plr.CharacterAdded:Connect(function(char)
  102.         task.wait(1)
  103.         expandHitbox(char)
  104.     end)
  105. end)
  106. -- Auto apply ke semua player yang sudah ada
  107. for _,plr in pairs(game.Players:GetPlayers()) do
  108.     if plr ~= player and plr.Character then
  109.         expandHitbox(plr.Character)
  110.     end
  111. end
  112. -- Fungsi Minimize
  113. MinimizeBtn.MouseButton1Click:Connect(function()
  114.     minimized = not minimized
  115.     if minimized then
  116.         Frame.Size = UDim2.new(0, 200, 0, 25)
  117.         for _,v in pairs(Frame:GetChildren()) do
  118.             if v ~= Title and v ~= MinimizeBtn then
  119.                 v.Visible = false
  120.             end
  121.         end
  122.         MinimizeBtn.Text = "+"
  123.     else
  124.         Frame.Size = UDim2.new(0, 200, 0, 120)
  125.         for _,v in pairs(Frame:GetChildren()) do
  126.             if v ~= Title and v ~= MinimizeBtn then
  127.                 v.Visible = true
  128.             end
  129.         end
  130.         MinimizeBtn.Text = "–"
  131.     end
  132. end)
Advertisement
Add Comment
Please, Sign In to add comment