Advertisement
coneman_2737

Hitbox

Jul 13th, 2023
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local players = game:GetService("Players")
  2. local local_player = players.LocalPlayer
  3. local run_service = game:GetService("RunService")
  4. local starter_gui = game:GetService("StarterGui")
  5.  
  6. local function extend_hitboxes(delta_time)
  7.     local character = local_player.Character
  8.  
  9.     if not character then
  10.         return
  11.     end
  12.  
  13.     local humanoid_root_part = character:FindFirstChild("HumanoidRootPart")
  14.  
  15.     if not humanoid_root_part then
  16.         return
  17.     end
  18.  
  19.     for _, player in pairs(players:GetPlayers()) do
  20.         if player == local_player then
  21.             continue
  22.         end
  23.  
  24.         local player_character = player.Character
  25.  
  26.         if not player_character then
  27.             continue
  28.         end
  29.  
  30.         local player_humanoid_root_part = player_character:FindFirstChild("HumanoidRootPart")
  31.  
  32.         if not player_humanoid_root_part then
  33.             continue
  34.         end
  35.  
  36.         local are_touching = false
  37.  
  38.         for _, part in pairs(workspace:GetPartsInPart(player_humanoid_root_part)) do
  39.             if part:IsDescendantOf(character) then
  40.                 are_touching = true
  41.                 break
  42.             end
  43.         end
  44.  
  45.         if player.Team == local_player.Team or are_touching then
  46.             player_humanoid_root_part.Size = Vector3.new(18, 18, 18)
  47.             player_humanoid_root_part.Transparency = 0.95
  48.             player_humanoid_root_part.BrickColor = player.Team.TeamColor
  49.             player_humanoid_root_part.Shape = Enum.PartType.Ball
  50.             player_humanoid_root_part.CanCollide = false
  51.             continue
  52.         end
  53.  
  54.         player_humanoid_root_part.Size = Vector3.new(18, 18, 18)
  55.         player_humanoid_root_part.Transparency = 0.7
  56.         player_humanoid_root_part.BrickColor = player.Team.TeamColor
  57.         player_humanoid_root_part.Shape = Enum.PartType.Ball
  58.         player_humanoid_root_part.CanCollide = true
  59.     end
  60. end
  61.  
  62. run_service.Stepped:Connect(extend_hitboxes)
  63.  
  64. starter_gui:SetCore("SendNotification", {
  65.     Title = "loaded";
  66.     Text = "yes, you did execute it";
  67.     Icon = "rbxassetid://10248739816";
  68. })
Tags: hitbox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement