Advertisement
Guest User

Hitbox extender

a guest
Jul 23rd, 2020
37,187
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.71 KB | None | 1 0
  1. --I dont own the script]]
  2.  
  3. repeat wait() until game:IsLoaded()
  4.  
  5. local Players = game:GetService("Players")
  6. local UserInputService = game:GetService("UserInputService")
  7. local plr = Players.LocalPlayer
  8. local size = 5 --change size of hitbox
  9. local key = "c" -- change key to what you want (https://developer.roblox.com/en-us/api-reference/enum/KeyCode)
  10. local bighead = true -- This changes if you want the head hitbox or not (If you record arsenal gameplay set the size to 3 because the head hitbox is invisible)
  11. local isVisible = true -- change this if u want to see head hit box
  12. local toggle = true
  13. key = key:sub(1, 1):upper()..key:sub(2, #key)
  14.  
  15. if isVisible then
  16.     isVisible = 0
  17. else
  18.     isVisible = 1
  19. end
  20.  
  21. UserInputService.InputEnded:Connect(function(input)
  22.     if UserInputService:GetFocusedTextBox() then return end
  23.     if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode[key] then
  24.         toggle = not toggle
  25.         for _,v in pairs(game.Players:GetPlayers()) do
  26.             if v ~= game.Players.LocalPlayer then
  27.                 update(v)
  28.             end
  29.         end
  30.     end
  31. end)
  32.  
  33. originalSizes = {LowerTorso=plr.Character.LowerTorso.Size,HumanoidRootPart=plr.Character.HumanoidRootPart.Size,HeadHB=plr.Character.HeadHB.Size}
  34.  
  35. function update(player)
  36.     if not player or not player.Character then return end
  37.     if toggle and player ~= plr and player.Status.Team.Value ~= plr.Status.Team.Value then
  38.         if bighead ~= true then
  39.             player.Character.LowerTorso.Size = Vector3.new(size,size,size)
  40.             player.Character.LowerTorso.Transparency = isVisible
  41.         else
  42.             player.Character.HeadHB.Size = Vector3.new(size,size,size)
  43.             player.Character.HeadHB.Transparency = isVisible
  44.         end
  45.         player.Character.HumanoidRootPart.Size = Vector3.new(size,size,size)
  46.         player.Character.HumanoidRootPart.Transparency = isVisible
  47.     else
  48.         player.Character.HeadHB.Transparency = 1
  49.         player.Character.LowerTorso.Size = originalSizes.LowerTorso
  50.         player.Character.HumanoidRootPart.Size = originalSizes.HumanoidRootPart
  51.         player.Character.HeadHB.Size = originalSizes.HeadHB
  52.     end
  53. end
  54.  
  55. function onjoin(player)
  56.     if player then player = game.Players[player.Name] else return end
  57.     player.Status.Team:GetPropertyChangedSignal("Value"):Connect(function()
  58.         update(player)
  59.     end)
  60.     update(player)
  61. end
  62.  
  63. game.Players.PlayerAdded:Connect(function(player)
  64.     player.CharacterAdded:Connect(onjoin)
  65. end)
  66.  
  67. for _,v in pairs(Players:GetPlayers()) do
  68.     v.Status.Team:GetPropertyChangedSignal("Value"):Connect(function()
  69.         if v == game.Players.LocalPlayer then
  70.             for _,b in pairs(Players:GetPlayers()) do
  71.                 if b ~= game.Players.LocalPlayer then
  72.                     update(b)
  73.                 end
  74.             end
  75.         else
  76.             update(v)
  77.         end
  78.     end)
  79.     if v ~= game.Players.LocalPlayer then
  80.         update(v)
  81.     end
  82. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement