Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Hitbox Settings
- getgenv().HitboxSize = Vector3.new(20, 20, 20) -- Desired size for the hitboxes
- getgenv().TargetPart = "HumanoidRootPart" -- Part of the character to resize
- getgenv().Enabled = true -- Toggle the script on/off
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- -- Function to modify the hitbox size
- local function updateHitbox(player)
- if getgenv().Enabled and player ~= LocalPlayer and player.Character then
- local targetPart = player.Character:FindFirstChild(getgenv().TargetPart)
- if targetPart and targetPart:IsA("BasePart") then
- targetPart.Size = getgenv().HitboxSize
- targetPart.Transparency = 0.5 -- Optional: makes it semi-transparent
- targetPart.CanCollide = false -- Avoids interference with gameplay
- end
- end
- end
- -- Function to apply the hitbox changes to all players
- local function applyToAllPlayers()
- for _, player in ipairs(Players:GetPlayers()) do
- updateHitbox(player)
- end
- end
- -- Detect when new players join and apply hitbox changes
- Players.PlayerAdded:Connect(function(player)
- player.CharacterAdded:Connect(function()
- updateHitbox(player)
- end)
- end)
- -- Apply hitbox changes to all existing players and detect respawns
- for _, player in ipairs(Players:GetPlayers()) do
- player.CharacterAdded:Connect(function()
- updateHitbox(player)
- end)
- updateHitbox(player) -- Ensure it applies to players already in the game
- end
- -- Initial application
- applyToAllPlayers()
- print("Hitbox script successfully loaded. Hitboxes set to:", tostring(getgenv().HitboxSize))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement