VenoxComeback

trans hitb

Apr 16th, 2025
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. -- Hitbox Settings
  2. getgenv().HitboxSize = Vector3.new(20, 20, 20) -- Desired size for the hitboxes
  3. getgenv().TargetPart = "HumanoidRootPart" -- Part of the character to resize
  4. getgenv().Enabled = true -- Toggle the script on/off
  5.  
  6. local Players = game:GetService("Players")
  7. local RunService = game:GetService("RunService")
  8. local LocalPlayer = Players.LocalPlayer
  9.  
  10. -- Function to modify the hitbox size
  11. local function updateHitbox(player)
  12. if getgenv().Enabled and player ~= LocalPlayer and player.Character then
  13. local targetPart = player.Character:FindFirstChild(getgenv().TargetPart)
  14. if targetPart and targetPart:IsA("BasePart") then
  15. targetPart.Size = getgenv().HitboxSize
  16. targetPart.Transparency = 1 -- Fully invisible
  17. targetPart.CanCollide = false -- So you can walk through it
  18. targetPart.Material = Enum.Material.ForceField -- Optional effect
  19. end
  20. end
  21. end
  22.  
  23. -- Function to hook character + reapply hitbox constantly
  24. local function hookPlayer(player)
  25. local function onCharacterAdded(character)
  26. -- Wait for the target part and keep updating it every frame
  27. RunService.RenderStepped:Connect(function()
  28. if getgenv().Enabled and player ~= LocalPlayer and player.Character then
  29. local part = player.Character:FindFirstChild(getgenv().TargetPart)
  30. if part and part:IsA("BasePart") then
  31. part.Size = getgenv().HitboxSize
  32. part.Transparency = 1
  33. part.CanCollide = false
  34. part.Material = Enum.Material.ForceField
  35. end
  36. end
  37. end)
  38. end
  39.  
  40. player.CharacterAdded:Connect(onCharacterAdded)
  41.  
  42. -- If character already exists
  43. if player.Character then
  44. onCharacterAdded(player.Character)
  45. end
  46. end
  47.  
  48. -- Apply to all current players
  49. for _, player in ipairs(Players:GetPlayers()) do
  50. hookPlayer(player)
  51. end
  52.  
  53. -- Auto-apply to new players
  54. Players.PlayerAdded:Connect(function(player)
  55. hookPlayer(player)
  56. end)
  57.  
Add Comment
Please, Sign In to add comment