ColdSpecs

Keybind head No comments

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