Advertisement
ColdSpecs

Multiple Head No Comments

Sep 7th, 2023
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. local settings = {
  2. headScale = Vector3.new(5, 5, 5)
  3. }
  4.  
  5. local plr = game:GetService("Players").LocalPlayer
  6. local newSizes = {}
  7. local userInputService = game:GetService("UserInputService")
  8.  
  9. local function changeHeadSize(object)
  10. if object and object:IsA("Part") then
  11. local originalSize = object.Size
  12. local newSize = settings.headScale
  13. object.Size = newSize
  14. print(object.Name)
  15. newSizes[object] = newSize
  16. end
  17. end
  18.  
  19. local function updateHeadSize(player)
  20. local character = player.Character or player.CharacterAdded:Wait()
  21. local head = character:FindFirstChild("Head")
  22. if head and head:IsA("Part") then
  23. if newSizes[head] then
  24. local size = newSizes[head]
  25. head.Size = size
  26. end
  27. end
  28. end
  29.  
  30. local function checkHeads()
  31. local models = workspace:GetChildren()
  32. local heads = {}
  33. for _, model in pairs(models) do
  34. if model:IsA("Model") and model:FindFirstChild("Head") then
  35. local head = model.Head
  36. table.insert(heads, head)
  37. end
  38. end
  39. for _, head in pairs(heads) do
  40. changeHeadSize(head)
  41. end
  42. end
  43.  
  44. checkHeads()
  45.  
  46. game.Players.PlayerAdded:Connect(function(player)
  47. updateHeadSize(player)
  48. player.CharacterAdded:Connect(function()
  49. updateHeadSize(player)
  50. end)
  51. end)
  52.  
  53. workspace.ChildAdded:Connect(function(child)
  54. if child:IsA("Model") and child:FindFirstChild("Head") then
  55. local head = child.Head
  56. changeHeadSize(head)
  57. end
  58. end)
  59.  
  60. workspace.ChildRemoved:Connect(function(child)
  61. if child:IsA("Model") and child:FindFirstChild("Head") then
  62. local head = child.Head
  63. newSizes[head] = nil
  64. end
  65. end)
  66.  
  67. userInputService.InputBegan:Connect(function(inputObject, gameProcessedEvent)
  68. if gameProcessedEvent then return end
  69. local keyCode = inputObject.KeyCode
  70. if keyCode == Enum.KeyCode.Q then
  71. settings.headScale = Vector3.new(12, 12, 12)
  72. checkHeads()
  73. elseif keyCode == Enum.KeyCode.F then
  74. settings.headScale = Vector3.new(7, 7, 7)
  75. checkHeads()
  76. elseif keyCode == Enum.KeyCode.Z then
  77. settings.headScale = Vector3.new(1, 1, 1)
  78. checkHeads()
  79. end
  80. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement