Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// Hitbox Script dengan Simple Draggable UI + Minimize + Auto Apply ke Player Baru
- local player = game.Players.LocalPlayer
- local hitboxEnabled = false
- local hitboxSize = 5
- local minimized = false
- -- Buat ScreenGui
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Parent = game.CoreGui
- -- Buat Frame (UI utama)
- local Frame = Instance.new("Frame")
- Frame.Parent = ScreenGui
- Frame.Size = UDim2.new(0, 200, 0, 120)
- Frame.Position = UDim2.new(0.3, 0, 0.3, 0)
- Frame.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
- Frame.BorderSizePixel = 0
- Frame.Active = true
- Frame.Draggable = true -- Bisa digeser
- -- Judul
- local Title = Instance.new("TextLabel")
- Title.Parent = Frame
- Title.Size = UDim2.new(1, -25, 0, 25)
- Title.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
- Title.Text = "Shadow .lol Hitbox"
- Title.TextColor3 = Color3.fromRGB(255, 255, 255)
- Title.Font = Enum.Font.SourceSansBold
- Title.TextSize = 16
- Title.TextXAlignment = Enum.TextXAlignment.Left
- -- Tombol Minimize
- local MinimizeBtn = Instance.new("TextButton")
- MinimizeBtn.Parent = Frame
- MinimizeBtn.Size = UDim2.new(0, 25, 0, 25)
- MinimizeBtn.Position = UDim2.new(1, -25, 0, 0)
- MinimizeBtn.Text = "–"
- MinimizeBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
- MinimizeBtn.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
- MinimizeBtn.Font = Enum.Font.SourceSansBold
- MinimizeBtn.TextSize = 18
- -- Tombol Toggle
- local Toggle = Instance.new("TextButton")
- Toggle.Parent = Frame
- Toggle.Size = UDim2.new(1, -20, 0, 30)
- Toggle.Position = UDim2.new(0, 10, 0, 35)
- Toggle.Text = "Enable Hitbox: OFF"
- Toggle.TextColor3 = Color3.fromRGB(255, 255, 255)
- Toggle.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- Toggle.Font = Enum.Font.SourceSans
- Toggle.TextSize = 16
- -- Slider sederhana (pakai TextBox)
- local SizeBox = Instance.new("TextBox")
- SizeBox.Parent = Frame
- SizeBox.Size = UDim2.new(1, -20, 0, 30)
- SizeBox.Position = UDim2.new(0, 10, 0, 75)
- SizeBox.Text = "Hitbox Size: 5"
- SizeBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- SizeBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- SizeBox.Font = Enum.Font.SourceSans
- SizeBox.TextSize = 16
- -- Fungsi expand hitbox
- local function expandHitbox(char)
- if not hitboxEnabled then return end
- local hrp = char:FindFirstChild("HumanoidRootPart")
- if hrp then
- hrp.Size = Vector3.new(hitboxSize, hitboxSize, hitboxSize)
- hrp.Transparency = 0.7
- hrp.BrickColor = BrickColor.new("Bright red")
- hrp.Material = Enum.Material.Neon
- hrp.CanCollide = false
- end
- end
- -- Toggle hitbox
- Toggle.MouseButton1Click:Connect(function()
- hitboxEnabled = not hitboxEnabled
- Toggle.Text = "Enable Hitbox: " .. (hitboxEnabled and "ON" or "OFF")
- for _,plr in pairs(game.Players:GetPlayers()) do
- if plr ~= player and plr.Character then
- expandHitbox(plr.Character)
- end
- end
- end)
- -- Ubah ukuran via TextBox
- SizeBox.FocusLost:Connect(function(enterPressed)
- if enterPressed then
- local val = tonumber(SizeBox.Text:match("%d+"))
- if val then
- hitboxSize = math.clamp(val, 2, 20)
- SizeBox.Text = "Hitbox Size: " .. hitboxSize
- if hitboxEnabled then
- for _,plr in pairs(game.Players:GetPlayers()) do
- if plr ~= player and plr.Character then
- expandHitbox(plr.Character)
- end
- end
- end
- else
- SizeBox.Text = "Hitbox Size: " .. hitboxSize
- end
- end
- end)
- -- Auto apply ke semua player yang join
- game.Players.PlayerAdded:Connect(function(plr)
- plr.CharacterAdded:Connect(function(char)
- task.wait(1)
- expandHitbox(char)
- end)
- end)
- -- Auto apply ke semua player yang sudah ada
- for _,plr in pairs(game.Players:GetPlayers()) do
- if plr ~= player and plr.Character then
- expandHitbox(plr.Character)
- end
- end
- -- Fungsi Minimize
- MinimizeBtn.MouseButton1Click:Connect(function()
- minimized = not minimized
- if minimized then
- Frame.Size = UDim2.new(0, 200, 0, 25)
- for _,v in pairs(Frame:GetChildren()) do
- if v ~= Title and v ~= MinimizeBtn then
- v.Visible = false
- end
- end
- MinimizeBtn.Text = "+"
- else
- Frame.Size = UDim2.new(0, 200, 0, 120)
- for _,v in pairs(Frame:GetChildren()) do
- if v ~= Title and v ~= MinimizeBtn then
- v.Visible = true
- end
- end
- MinimizeBtn.Text = "–"
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment