Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to expand hitbox
- local function expandHitbox(player)
- if player ~= game.Players.LocalPlayer then
- local head = player.Character:FindFirstChild("Head")
- if head then
- head.Size = Vector3.new(100, 100, 100)
- head.Transparency = 0.5
- head.CanCollide = false
- end
- end
- end
- -- Function to toggle hitbox expansion
- local hitboxExpanded = false
- local function toggleHitboxExpansion()
- hitboxExpanded = not hitboxExpanded
- for _, player in pairs(game:GetService("Players"):GetPlayers()) do
- if player.Character then
- expandHitbox(player)
- end
- end
- end
- -- Create the ScreenGui
- local player = game.Players.LocalPlayer
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "HitboxScreenGui"
- screenGui.ResetOnSpawn = false -- Ensure the GUI doesn't reset on respawn
- screenGui.Parent = player:WaitForChild("PlayerGui")
- -- Create the toggle button in the top-left of the screen
- local toggleButton = Instance.new("TextButton")
- toggleButton.Size = UDim2.new(0, 150, 0, 50)
- toggleButton.Position = UDim2.new(0, 10, 0, 10) -- Top-left position
- toggleButton.Text = "Toggle Hitbox Size"
- toggleButton.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- toggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggleButton.Parent = screenGui
- -- Flag to check if text has been shown
- local textShown = false
- -- Function to show text on screen
- local function showText()
- if not textShown then
- textShown = true
- local textLabel = Instance.new("TextLabel")
- textLabel.Size = UDim2.new(0, 300, 0, 50)
- textLabel.Position = UDim2.new(0.5, -150, 0, 10) -- Center top position
- textLabel.Text = "THIS SCRIPT IS MADE BY DD"
- textLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- textLabel.Parent = screenGui
- -- Remove the text after 5 seconds
- wait(5)
- textLabel:Destroy()
- end
- end
- -- Toggle hitbox size on button click
- toggleButton.MouseButton1Click:Connect(function()
- toggleHitboxExpansion()
- if hitboxExpanded then
- toggleButton.Text = "Hitbox ON"
- else
- toggleButton.Text = "Hitbox OFF"
- end
- showText() -- Show the text when the button is clicked
- end)
- -- Apply hitbox expander to new players
- game:GetService("Players").PlayerAdded:Connect(function(player)
- player.CharacterAdded:Connect(function(character)
- if hitboxExpanded then
- expandHitbox(player)
- end
- end)
- end)
- -- Ensure the GUI stays when the player respawns
- player.CharacterAdded:Connect(function()
- toggleButton.Parent = player:WaitForChild("PlayerGui"):WaitForChild("HitboxScreenGui")
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement