
KeylessUniversal

-- ============================================================
-- SLAP BATTLES UTILITY SCRIPT
-- Features: Hitbox Expander | Auto Slap | Walk Speed
-- ============================================================
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local Mouse = LocalPlayer:GetMouse()
-- ============================================================
-- STATE
-- ============================================================
local State = {
HitboxExpander = {
Enabled = false,
Size = 15,
},
AutoSlap = {
Enabled = false,
Range = 20,
Connection = nil,
},
WalkSpeed = {
Enabled = false,
Speed = 50,
DefaultSpeed = 16,
},
GUI = {
Dragging = false,
DragOffset = Vector2.new(0, 0),
}
}
-- ============================================================
-- GUI CONSTRUCTION
-- ============================================================
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "SBUtility"
ScreenGui.ResetOnSpawn = false
ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
ScreenGui.Parent = game:GetService("CoreGui")
-- Main Frame
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(0, 280, 0, 340)
MainFrame.Position = UDim2.new(0.5, -140, 0.5, -170)
MainFrame.BackgroundColor3 = Color3.fromRGB(15, 15, 20)
MainFrame.BorderSizePixel = 0
MainFrame.Active = true
MainFrame.Parent = ScreenGui
local MainCorner = Instance.new("UICorner")
MainCorner.CornerRadius = UDim.new(0, 10)
MainCorner.Parent = MainFrame
local MainStroke = Instance.new("UIStroke")
MainStroke.Color = Color3.fromRGB(255, 80, 80)
MainStroke.Thickness = 1.5
MainStroke.Parent = MainFrame
-- Title Bar
local TitleBar = Instance.new("Frame")
TitleBar.Name = "TitleBar"
TitleBar.Size = UDim2.new(1, 0, 0, 40)
TitleBar.Position = UDim2.new(0, 0, 0, 0)
TitleBar.BackgroundColor3 = Color3.fromRGB(255, 60, 60)
TitleBar.BorderSizePixel = 0
TitleBar.Parent = MainFrame
local TitleCorner = Instance.new("UICorner")
TitleCorner.CornerRadius = UDim.new(0, 10)
TitleCorner.Parent = TitleBar
local TitleFix = Instance.new("Frame")
TitleFix.Size = UDim2.new(1, 0, 0.5, 0)
TitleFix.Position = UDim2.new(0, 0, 0.5, 0)
TitleFix.BackgroundColor3 = Color3.fromRGB(255, 60, 60)
TitleFix.BorderSizePixel = 0
TitleFix.Parent = TitleBar
local TitleLabel = Instance.new("TextLabel")
TitleLabel.Text = "⚡ SB UTILITY"
TitleLabel.Size = UDim2.new(1, -50, 1, 0)
TitleLabel.Position = UDim2.new(0, 12, 0, 0)
TitleLabel.BackgroundTransparency = 1
TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
TitleLabel.TextSize = 15
TitleLabel.Font = Enum.Font.GothamBold
TitleLabel.TextXAlignment = Enum.TextXAlignment.Left
TitleLabel.Parent = TitleBar
local MinimizeBtn = Instance.new("TextButton")
MinimizeBtn.Text = "−"
MinimizeBtn.Size = UDim2.new(0, 30, 0, 30)
MinimizeBtn.Position = UDim2.new(1, -38, 0, 5)
MinimizeBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
MinimizeBtn.BackgroundTransparency = 0.85
MinimizeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
MinimizeBtn.TextSize = 18
MinimizeBtn.Font = Enum.Font.GothamBold
MinimizeBtn.BorderSizePixel = 0
MinimizeBtn.Parent = TitleBar
local MinimizeCorner = Instance.new("UICorner")
MinimizeCorner.CornerRadius = UDim.new(0, 6)
MinimizeCorner.Parent = MinimizeBtn
-- Content Frame
local ContentFrame = Instance.new("Frame")
ContentFrame.Name = "ContentFrame"
ContentFrame.Size = UDim2.new(1, 0, 1, -40)
ContentFrame.Position = UDim2.new(0, 0, 0, 40)
ContentFrame.BackgroundTransparency = 1
ContentFrame.Parent = MainFrame
local ContentPadding = Instance.new("UIPadding")
ContentPadding.PaddingLeft = UDim.new(0, 14)
ContentPadding.PaddingRight = UDim.new(0, 14)
ContentPadding.PaddingTop = UDim.new(0, 12)
ContentPadding.Parent = ContentFrame
-- ============================================================
-- COMPONENT BUILDER
-- ============================================================
local function MakeToggle(parent, yPos, labelText, accentColor)
local Container = Instance.new("Frame")
Container.Size = UDim2.new(1, 0, 0, 38)
Container.Position = UDim2.new(0, 0, 0, yPos)
Container.BackgroundColor3 = Color3.fromRGB(25, 25, 32)
Container.BorderSizePixel = 0
Container.Parent = parent
local ContCorner = Instance.new("UICorner")
ContCorner.CornerRadius = UDim.new(0, 8)
ContCorner.Parent = Container
local Label = Instance.new("TextLabel")
Label.Text = labelText
Label.Size = UDim2.new(1, -60, 1, 0)
Label.Position = UDim2.new(0, 12, 0, 0)
Label.BackgroundTransparency = 1
Label.TextColor3 = Color3.fromRGB(220, 220, 220)
Label.TextSize = 13
Label.Font = Enum.Font.GothamSemibold
Label.TextXAlignment = Enum.TextXAlignment.Left
Label.Parent = Container
local ToggleBg = Instance.new("Frame")
ToggleBg.Size = UDim2.new(0, 40, 0, 22)
ToggleBg.Position = UDim2.new(1, -52, 0.5, -11)
ToggleBg.BackgroundColor3 = Color3.fromRGB(50, 50, 60)
ToggleBg.BorderSizePixel = 0
ToggleBg.Parent = Container
local TBCorner = Instance.new("UICorner")
TBCorner.CornerRadius = UDim.new(1, 0)
TBCorner.Parent = ToggleBg
local Knob = Instance.new("Frame")
Knob.Size = UDim2.new(0, 16, 0, 16)
Knob.Position = UDim2.new(0, 3, 0.5, -8)
Knob.BackgroundColor3 = Color3.fromRGB(180, 180, 180)
Knob.BorderSizePixel = 0
Knob.Parent = ToggleBg
local KnobCorner = Instance.new("UICorner")
KnobCorner.CornerRadius = UDim.new(1, 0)
KnobCorner.Parent = Knob
local IsOn = false
local TweenInfo_ = TweenInfo.new(0.18, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local ClickRegion = Instance.new("TextButton")
ClickRegion.Size = UDim2.new(1, 0, 1, 0)
ClickRegion.BackgroundTransparency = 1
ClickRegion.Text = ""
ClickRegion.Parent = Container
local Callbacks = {}
ClickRegion.MouseButton1Click:Connect(function()
IsOn = not IsOn
local targetKnobX = IsOn and UDim2.new(1, -19, 0.5, -8) or UDim2.new(0, 3, 0.5, -8)
local targetBg = IsOn and accentColor or Color3.fromRGB(50, 50, 60)
local targetKnob = IsOn and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(180, 180, 180)
TweenService:Create(Knob, TweenInfo_, { Position = targetKnobX, BackgroundColor3 = targetKnob }):Play()
TweenService:Create(ToggleBg, TweenInfo_, { BackgroundColor3 = targetBg }):Play()
for _, cb in ipairs(Callbacks) do cb(IsOn) end
end)
return {
Container = Container,
OnToggle = function(cb) table.insert(Callbacks, cb) end,
GetState = function() return IsOn end,
}
end
local function MakeSlider(parent, yPos, labelText, minVal, maxVal, defaultVal, accentColor)
local Container = Instance.new("Frame")
Container.Size = UDim2.new(1, 0, 0, 56)
Container.Position = UDim2.new(0, 0, 0, yPos)
Container.BackgroundColor3 = Color3.fromRGB(25, 25, 32)
Container.BorderSizePixel = 0
Container.Parent = parent
local ContCorner = Instance.new("UICorner")
ContCorner.CornerRadius = UDim.new(0, 8)
ContCorner.Parent = Container
local HeaderRow = Instance.new("Frame")
HeaderRow.Size = UDim2.new(1, 0, 0, 26)
HeaderRow.Position = UDim2.new(0, 0, 0, 0)
HeaderRow.BackgroundTransparency = 1
HeaderRow.Parent = Container
local Label = Instance.new("TextLabel")
Label.Text = labelText
Label.Size = UDim2.new(0.7, 0, 1, 0)
Label.Position = UDim2.new(0, 12, 0, 0)
Label.BackgroundTransparency = 1
Label.TextColor3 = Color3.fromRGB(220, 220, 220)
Label.TextSize = 12
Label.Font = Enum.Font.GothamSemibold
Label.TextXAlignment = Enum.TextXAlignment.Left
Label.Parent = HeaderRow
local ValueLabel = Instance.new("TextLabel")
ValueLabel.Text = tostring(defaultVal)
ValueLabel.Size = UDim2.new(0.3, -12, 1, 0)
ValueLabel.Position = UDim2.new(0.7, 0, 0, 0)
ValueLabel.BackgroundTransparency = 1
ValueLabel.TextColor3 = accentColor
ValueLabel.TextSize = 12
ValueLabel.Font = Enum.Font.GothamBold
ValueLabel.TextXAlignment = Enum.TextXAlignment.Right
ValueLabel.Parent = HeaderRow
local TrackBg = Instance.new("Frame")
TrackBg.Size = UDim2.new(1, -24, 0, 6)
TrackBg.Position = UDim2.new(0, 12, 0, 36)
TrackBg.BackgroundColor3 = Color3.fromRGB(50, 50, 60)
TrackBg.BorderSizePixel = 0
TrackBg.Parent = Container
local TrackCorner = Instance.new("UICorner")
TrackCorner.CornerRadius = UDim.new(1, 0)
TrackCorner.Parent = TrackBg
local Fill = Instance.new("Frame")
Fill.Size = UDim2.new((defaultVal - minVal) / (maxVal - minVal), 0, 1, 0)
Fill.BackgroundColor3 = accentColor
Fill.BorderSizePixel = 0
Fill.Parent = TrackBg
local FillCorner = Instance.new("UICorner")
FillCorner.CornerRadius = UDim.new(1, 0)
FillCorner.Parent = Fill
local Thumb = Instance.new("Frame")
Thumb.Size = UDim2.new(0, 14, 0, 14)
Thumb.AnchorPoint = Vector2.new(0.5, 0.5)
Thumb.Position = UDim2.new((defaultVal - minVal) / (maxVal - minVal), 0, 0.5, 0)
Thumb.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
Thumb.BorderSizePixel = 0
Thumb.ZIndex = 3
Thumb.Parent = TrackBg
local ThumbCorner = Instance.new("UICorner")
ThumbCorner.CornerRadius = UDim.new(1, 0)
ThumbCorner.Parent = Thumb
local CurrentVal = defaultVal
local Dragging = false
local Callbacks = {}
local DragButton = Instance.new("TextButton")
DragButton.Size = UDim2.new(1, 0, 0, 20)
DragButton.Position = UDim2.new(0, 0, 0, 30)
DragButton.BackgroundTransparency = 1
DragButton.Text = ""
DragButton.ZIndex = 5
DragButton.Parent = Container
local function UpdateSlider(inputX)
local trackAbsPos = TrackBg.AbsolutePosition.X
local trackAbsSize = TrackBg.AbsoluteSize.X
local ratio = math.clamp((inputX - trackAbsPos) / trackAbsSize, 0, 1)
CurrentVal = math.floor(minVal + (maxVal - minVal) * ratio)
Fill.Size = UDim2.new(ratio, 0, 1, 0)
Thumb.Position = UDim2.new(ratio, 0, 0.5, 0)
ValueLabel.Text = tostring(CurrentVal)
for _, cb in ipairs(Callbacks) do cb(CurrentVal) end
end
DragButton.MouseButton1Down:Connect(function()
Dragging = true
UpdateSlider(Mouse.X)
end)
UserInputService.InputChanged:Connect(function(input)
if Dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
UpdateSlider(input.Position.X)
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
Dragging = false
end
end)
return {
Container = Container,
OnChange = function(cb) table.insert(Callbacks, cb) end,
GetValue = function() return CurrentVal end,
}
end
local function MakeSectionLabel(parent, yPos, text)
local Label = Instance.new("TextLabel")
Label.Text = text
Label.Size = UDim2.new(1, 0, 0, 20)
Label.Position = UDim2.new(0, 0, 0, yPos)
Label.BackgroundTransparency = 1
Label.TextColor3 = Color3.fromRGB(120, 120, 140)
Label.TextSize = 11
Label.Font = Enum.Font.GothamSemibold
Label.TextXAlignment = Enum.TextXAlignment.Left
Label.Parent = parent
return Label
end
-- ============================================================
-- BUILD THE FEATURE PANELS
-- ============================================================
-- Section: Combat
MakeSectionLabel(ContentFrame, 0, "COMBAT")
local HitboxToggle = MakeToggle(ContentFrame, 22, "Hitbox Expander", Color3.fromRGB(255, 80, 80))
local HitboxSlider = MakeSlider(ContentFrame, 68, "Hitbox Size", 5, 50, 15, Color3.fromRGB(255, 80, 80))
local AutoSlapToggle = MakeToggle(ContentFrame, 132, "Auto Slap", Color3.fromRGB(255, 130, 60))
local AutoSlapSlider = MakeSlider(ContentFrame, 178, "Slap Range", 5, 60, 20, Color3.fromRGB(255, 130, 60))
-- Section: Movement
MakeSectionLabel(ContentFrame, 242, "MOVEMENT")
local SpeedToggle = MakeToggle(ContentFrame, 264, "Walk Speed", Color3.fromRGB(100, 180, 255))
local SpeedSlider = MakeSlider(ContentFrame, 310, "Speed Value", 16, 150, 50, Color3.fromRGB(100, 180, 255))
-- ============================================================
-- DRAG LOGIC
-- ============================================================
TitleBar.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
State.GUI.Dragging = true
State.GUI.DragOffset = Vector2.new(
input.Position.X - MainFrame.AbsolutePosition.X,
input.Position.Y - MainFrame.AbsolutePosition.Y
)
end
end)
TitleBar.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
State.GUI.Dragging = false
end
end)
UserInputService.InputChanged:Connect(function(input)
if State.GUI.Dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
MainFrame.Position = UDim2.new(
0, input.Position.X - State.GUI.DragOffset.X,
0, input.Position.Y - State.GUI.DragOffset.Y
)
end
end)
-- ============================================================
-- MINIMIZE LOGIC
-- ============================================================
local Minimized = false
MinimizeBtn.MouseButton1Click:Connect(function()
Minimized = not Minimized
ContentFrame.Visible = not Minimized
MainFrame.Size = Minimized and UDim2.new(0, 280, 0, 40) or UDim2.new(0, 280, 0, 390)
MinimizeBtn.Text = Minimized and "+" or "−"
end)
-- ============================================================
-- FEATURE: HITBOX EXPANDER
-- ============================================================
local function ExpandHitboxes(size)
for _, player in ipairs(Players:GetPlayers()) do
if player ~= LocalPlayer and player.Character then
local hrp = player.Character:FindFirstChild("HumanoidRootPart")
if hrp then
hrp.Size = Vector3.new(size, size, size)
hrp.Transparency = 0.8
hrp.CanCollide = false
end
end
end
end
local function ResetHitboxes()
for _, player in ipairs(Players:GetPlayers()) do
if player ~= LocalPlayer and player.Character then
local hrp = player.Character:FindFirstChild("HumanoidRootPart")
if hrp then
hrp.Size = Vector3.new(2, 2, 1)
hrp.Transparency = 1
end
end
end
end
HitboxToggle.OnToggle(function(state)
State.HitboxExpander.Enabled = state
if not state then ResetHitboxes() end
end)
HitboxSlider.OnChange(function(val)
State.HitboxExpander.Size = val
end)
-- ============================================================
-- FEATURE: AUTO SLAP
-- ============================================================
local function GetClosestPlayer(range)
local hrp = Character:FindFirstChild("HumanoidRootPart")
if not hrp then return nil end
local closest, closestDist = nil, range
for _, player in ipairs(Players:GetPlayers()) do
if player ~= LocalPlayer and player.Character then
local otherHrp = player.Character:FindFirstChild("HumanoidRootPart")
local hum = player.Character:FindFirstChildOfClass("Humanoid")
if otherHrp and hum and hum.Health > 0 then
local dist = (hrp.Position - otherHrp.Position).Magnitude
if dist < closestDist then
closestDist = dist
closest = player
end
end
end
end
return closest
end
local function TriggerSlap(targetPlayer)
local tool = LocalPlayer.Backpack:FindFirstChildOfClass("Tool")
or (Character and Character:FindFirstChildOfClass("Tool"))
if not tool then return end
if not Character:FindFirstChild(tool.Name) then
humanoid = Character:FindFirstChildOfClass("Humanoid")
if humanoid then humanoid:EquipTool(tool) end
end
local targetHrp = targetPlayer.Character and targetPlayer.Character:FindFirstChild("HumanoidRootPart")
if not targetHrp then return end
local event = tool:FindFirstChild("SlapEvent") or tool:FindFirstChildOfClass("RemoteEvent")
if event then
pcall(function()
event:FireServer(targetHrp.CFrame.Position)
end)
end
local localHrp = Character:FindFirstChild("HumanoidRootPart")
if localHrp then
localHrp.CFrame = CFrame.new(
targetHrp.Position - (targetHrp.CFrame.LookVector * 3),
targetHrp.Position
)
end
end
AutoSlapToggle.OnToggle(function(state)
State.AutoSlap.Enabled = state
if State.AutoSlap.Connection then
State.AutoSlap.Connection:Disconnect()
State.AutoSlap.Connection = nil
end
if state then
State.AutoSlap.Connection = RunService.Heartbeat:Connect(function()
if not State.AutoSlap.Enabled then return end
local target = GetClosestPlayer(State.AutoSlap.Range)
if target then
TriggerSlap(target)
end
end)
end
end)
AutoSlapSlider.OnChange(function(val)
State.AutoSlap.Range = val
end)
-- ============================================================
-- FEATURE: WALK SPEED
-- ============================================================
local SpeedConnection = nil
local function ApplySpeed(speed)
local hum = Character and Character:FindFirstChildOfClass("Humanoid")
if hum then
hum.WalkSpeed = speed
end
end
local function ResetSpeed()
ApplySpeed(State.WalkSpeed.DefaultSpeed)
end
SpeedToggle.OnToggle(function(state)
State.WalkSpeed.Enabled = state
if SpeedConnection then
SpeedConnection:Disconnect()
SpeedConnection = nil
end
if state then
ApplySpeed(State.WalkSpeed.Speed)
SpeedConnection = RunService.Heartbeat:Connect(function()
if not State.WalkSpeed.Enabled then return end
local hum = Character and Character:FindFirstChildOfClass("Humanoid")
if hum and hum.WalkSpeed ~= State.WalkSpeed.Speed then
hum.WalkSpeed = State.WalkSpeed.Speed
end
end)
else
ResetSpeed()
end
end)
SpeedSlider.OnChange(function(val)
State.WalkSpeed.Speed = val
if State.WalkSpeed.Enabled then
ApplySpeed(val)
end
end)
-- ============================================================
-- CHARACTER RESPAWN HANDLING
-- ============================================================
LocalPlayer.CharacterAdded:Connect(function(newChar)
Character = newChar
newChar:WaitForChild("HumanoidRootPart")
newChar:WaitForChild("Humanoid")
task.wait(0.5)
if State.WalkSpeed.Enabled then
ApplySpeed(State.WalkSpeed.Speed)
end
end)
-- ============================================================
-- HITBOX LOOP
-- ============================================================
RunService.Heartbeat:Connect(function()
if State.HitboxExpander.Enabled then
ExpandHitboxes(State.HitboxExpander.Size)
end
end)
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
task.wait(1)
if State.HitboxExpander.Enabled then
ExpandHitboxes(State.HitboxExpander.Size)
end
end)
end)No comments yet for this script.



