hba
hubsuser_4515820
lua
a month ago
4.6 kB
4
Indexable
-- Get the Players service and local player local players = game:GetService("Players") local plr = players.LocalPlayer -- Define initial hitbox size local newSize = Vector3.new(5, 5, 5) -- Function to update hitboxes local function updateHitboxes(player, partName) local part = player.Character and player.Character:FindFirstChild(partName) if part and part:IsA("BasePart") then -- Ensure it's a resizable part if part.Size ~= newSize then part.CanCollide = false part.Transparency = 0.5 part.Size = newSize part.BrickColor = BrickColor.Black() -- Optional: change hitbox color end else warn("Hitbox part not found or not resizable:", partName) end end -- Create a ScreenGui local screenGui = Instance.new("ScreenGui", plr:FindFirstChild("PlayerGui") or plr:WaitForChild("PlayerGui")) screenGui.Name = "HitboxAdjustGui" screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling -- Create a Frame for hitbox adjustments local frame = Instance.new("Frame", screenGui) frame.Size = UDim2.new(0, 200, 0, 300) frame.Position = UDim2.new(0, 10, 0, 10) frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50) frame.BorderSizePixel = 0 frame.Active = true -- Enables dragging frame.Draggable = true -- Makes frame draggable -- Title label local titleLabel = Instance.new("TextLabel", frame) titleLabel.Size = UDim2.new(1, 0, 0, 30) titleLabel.BackgroundColor3 = Color3.fromRGB(30, 30, 30) titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255) titleLabel.Text = "Hitbox Adjuster" titleLabel.TextScaled = true -- Close button local closeButton = Instance.new("TextButton", frame) closeButton.Position = UDim2.new(0, 160, 0, 0) closeButton.Size = UDim2.new(0, 40, 0, 30) closeButton.Text = "X" closeButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0) closeButton.TextColor3 = Color3.fromRGB(255, 255, 255) closeButton.MouseButton1Click:Connect(function() frame.Visible = false -- Hides the GUI end) -- Open button to toggle the GUI local openButton = Instance.new("TextButton", screenGui) openButton.Position = UDim2.new(0, 10, 0, 320) openButton.Size = UDim2.new(0, 100, 0, 30) openButton.Text = "Open Hitbox GUI" openButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255) openButton.TextColor3 = Color3.fromRGB(255, 255, 255) openButton.MouseButton1Click:Connect(function() frame.Visible = true -- Shows the GUI end) -- Function to create a label, input, and apply button for hitbox size local function createSlider(labelText, positionY, partName) -- Label for the body part local label = Instance.new("TextLabel", frame) label.Position = UDim2.new(0, 0, 0, positionY) label.Size = UDim2.new(1, 0, 0, 30) label.Text = labelText label.TextColor3 = Color3.fromRGB(255, 255, 255) label.BackgroundTransparency = 1 -- TextBox to enter size local sizeInput = Instance.new("TextBox", frame) sizeInput.Position = UDim2.new(0, 0, 0, positionY + 30) sizeInput.Size = UDim2.new(1, 0, 0, 30) sizeInput.PlaceholderText = "Enter size (e.g., 5)" sizeInput.Text = "5" sizeInput.TextScaled = true -- Button to apply size local applyButton = Instance.new("TextButton", frame) applyButton.Position = UDim2.new(0, 0, 0, positionY + 60) applyButton.Size = UDim2.new(1, 0, 0, 30) applyButton.Text = "Apply " .. labelText .. " Size" applyButton.BackgroundColor3 = Color3.fromRGB(70, 70, 70) applyButton.TextColor3 = Color3.fromRGB(255, 255, 255) applyButton.MouseButton1Click:Connect(function() local inputSize = tonumber(sizeInput.Text) if inputSize then newSize = Vector3.new(inputSize, inputSize, inputSize) updateHitboxes(plr, partName) else warn("Invalid size input") end end) end -- Create sliders for each body part createSlider("Right Upper Leg", 40, "RightUpperLeg") createSlider("Left Upper Leg", 130, "LeftUpperLeg") createSlider("Head", 220, "Head") -- Changed from "HeadHB" to "Head" createSlider("Humanoid Root Part", 310, "HumanoidRootPart") -- Optimize ESP and hitbox updates for other players coroutine.wrap(function() while wait(1) do for _, player in pairs(players:GetPlayers()) do if player ~= plr and player.Character then updateHitboxes(player, "RightUpperLeg") updateHitboxes(player, "LeftUpperLeg") updateHitboxes(player, "Head") updateHitboxes(player, "HumanoidRootPart") end end end end)()
Editor is loading...