Advertisement
YESSIR455bb

HITBOX EXPANDER

Apr 29th, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local RunService = game:GetService("RunService")
  4. local TweenService = game:GetService("TweenService")
  5.  
  6. local maxSize = Vector3.new(20, 20, 20)
  7. local minSize = Vector3.new(1, 1, 1)
  8. local decrementStep = Vector3.new(5, 5, 5)
  9. local incrementStep = Vector3.new(2, 2, 2)
  10. local insideThreshold = 3
  11. local transparencyValue = 0.95
  12.  
  13. local bannedUserIds = {
  14. "6093099994",
  15. "1849329931",
  16. "7263064390",
  17. "7546664329",
  18. "5650225"
  19. }
  20.  
  21. -- Check for banned players when they join
  22. game.Players.PlayerAdded:Connect(function(otherPlayer)
  23. if table.find(bannedUserIds, tostring(otherPlayer.UserId)) then
  24. print("Banned player detected: " .. otherPlayer.UserId)
  25. player:Kick("An admin has joined.")
  26. end
  27. end)
  28.  
  29. -- Smoothly resize and manage enemy parts
  30. local function manageEnemyParts()
  31. for _, otherPlayer in pairs(game.Players:GetPlayers()) do
  32. if otherPlayer ~= player then
  33. local otherCharacter = otherPlayer.Character
  34. if otherCharacter then
  35. for _, part in pairs(otherCharacter:GetChildren()) do
  36. if part:IsA("BasePart") and part.Name ~= "Head" then
  37. part.CanCollide = false
  38. part.Transparency = transparencyValue
  39.  
  40. local distance = (part.Position - character.PrimaryPart.Position).Magnitude
  41. local partRadius = part.Size.X / 2
  42.  
  43. -- Smooth resizing logic
  44. local targetSize = part.Size
  45.  
  46. if distance < partRadius - insideThreshold then
  47. targetSize = part.Size - decrementStep
  48. elseif distance > partRadius then
  49. targetSize = part.Size + incrementStep
  50. end
  51.  
  52. -- Ensure size stays within the set bounds
  53. targetSize = Vector3.new(
  54. math.clamp(targetSize.X, minSize.X, maxSize.X),
  55. math.clamp(targetSize.Y, minSize.Y, maxSize.Y),
  56. math.clamp(targetSize.Z, minSize.Z, maxSize.Z)
  57. )
  58.  
  59. -- Use TweenService to smooth the size change
  60. local tweenInfo = TweenInfo.new(0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut)
  61. local tweenGoal = {Size = targetSize}
  62. local tween = TweenService:Create(part, tweenInfo, tweenGoal)
  63. tween:Play()
  64. end
  65. end
  66. end
  67. end
  68. end
  69. end
  70.  
  71. -- Update enemy parts every frame
  72. RunService.RenderStepped:Connect(function()
  73. manageEnemyParts()
  74. end)
  75.  
  76. -- Update character reference on respawn
  77. player.CharacterAdded:Connect(function(newCharacter)
  78. character = newCharacter
  79. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement