Advertisement
MawinCK

Head hitbox Expander v3 By me Fixed + Better

May 10th, 2024 (edited)
2,008
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.63 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local service = game:GetService("Players")
  3.  
  4. local isResizing = false
  5.  
  6. function resizeHeadHitbox(character)
  7.     local head = character:WaitForChild("Head", 5) -- Wait for head to load, with a timeout of 5 seconds
  8.     if head then
  9.         -- Increase head size
  10.         head.Size = Vector3.new(5, 5, 5)
  11.         -- Decrease transparency
  12.         head.Transparency = 0.5
  13.     end
  14. end
  15.  
  16. function resetHeadHitbox(character)
  17.     local head = character:FindFirstChild("Head")
  18.     if head then
  19.         -- Reset head size
  20.         head.Size = Vector3.new(1, 1, 1)
  21.         -- Reset transparency
  22.         head.Transparency = 0
  23.     end
  24. end
  25.  
  26. for _, otherPlayer in ipairs(service:GetPlayers()) do
  27.     otherPlayer.CharacterAdded:Connect(function(character)
  28.         if isResizing then
  29.             wait(1) -- Wait a second before resizing head to ensure character has fully loaded
  30.             resizeHeadHitbox(character)
  31.         end
  32.     end)
  33. end
  34.  
  35. game:GetService("UserInputService").InputBegan:Connect(function(input)
  36.     if input.KeyCode == Enum.KeyCode.M then
  37.         isResizing = not isResizing -- Toggle resizing
  38.         if isResizing then
  39.             for _, otherPlayer in ipairs(service:GetPlayers()) do
  40.                 resizeHeadHitbox(otherPlayer.Character)
  41.             end
  42.         else
  43.             for _, otherPlayer in ipairs(service:GetPlayers()) do
  44.                 resetHeadHitbox(otherPlayer.Character)
  45.             end
  46.         end
  47.     end
  48. end)
  49.  
  50. -- Adding fog removal (you can remove this if not needed)
  51. game:GetService("Lighting").FogEnd = 99999
  52. game:GetService("Lighting").FogStart = 99999
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement