Advertisement
MaxproGlitcher

Hit Box Béta Max

May 18th, 2024 (edited)
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local LocalPlayer = Players.LocalPlayer
  3.  
  4. -- Function to move other players' heads
  5. local function MovePlayerHead(player)
  6. local character = player.Character
  7. if character then
  8. local head = character:FindFirstChild("Head")
  9. if head then
  10. local headCFrame = head.CFrame
  11. local localHead = LocalPlayer.Character:FindFirstChild("Head")
  12. if localHead then
  13. -- Move other player's head in front of local player
  14. head.CFrame = localHead.CFrame * CFrame.new(0, 0, -3)
  15. end
  16. -- Hide other player's body parts except for the head
  17. for _, part in ipairs(character:GetChildren()) do
  18. if part.Name ~= "Head" then
  19. if part:IsA("BasePart") then
  20. part.Transparency = 1
  21. end
  22. end
  23. end
  24. end
  25. end
  26. end
  27.  
  28. -- Function to refresh continuously
  29. local function RefreshPlayerHeads()
  30. while true do
  31. -- Call MovePlayerHead for each player
  32. for _, player in ipairs(Players:GetPlayers()) do
  33. if player ~= LocalPlayer then
  34. MovePlayerHead(player)
  35. end
  36. end
  37. -- Wait for a short time before refreshing again
  38. wait() -- This will wait for one frame before refreshing again
  39. end
  40. end
  41.  
  42. -- Connect function to each player
  43. Players.PlayerAdded:Connect(function(player)
  44. -- Call the MovePlayerHead function whenever a new player joins
  45. MovePlayerHead(player)
  46. end)
  47.  
  48. -- Call the MovePlayerHead function for each player already in the game
  49. for _, player in ipairs(Players:GetPlayers()) do
  50. if player ~= LocalPlayer then
  51. MovePlayerHead(player)
  52. end
  53. end
  54.  
  55. -- Start the RefreshPlayerHeads coroutine
  56. coroutine.wrap(RefreshPlayerHeads)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement