Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local settings = {
- headScale = Vector3.new(5, 5, 5)
- }
- local plr = game:GetService("Players").LocalPlayer
- local newSizes = {}
- local userInputService = game:GetService("UserInputService")
- local function changeHeadSize(object)
- if object and object:IsA("Part") then
- local originalSize = object.Size
- local newSize = settings.headScale
- object.Size = newSize
- print(object.Name)
- newSizes[object] = newSize
- end
- end
- local function updateHeadSize(player)
- local character = player.Character or player.CharacterAdded:Wait()
- local head = character:FindFirstChild("Head")
- if head and head:IsA("Part") then
- if newSizes[head] then
- local size = newSizes[head]
- head.Size = size
- end
- end
- end
- local function checkHeads()
- local models = workspace:GetChildren()
- local heads = {}
- for _, model in pairs(models) do
- if model:IsA("Model") and model:FindFirstChild("Head") then
- local head = model.Head
- table.insert(heads, head)
- end
- end
- for _, head in pairs(heads) do
- changeHeadSize(head)
- end
- end
- checkHeads()
- game.Players.PlayerAdded:Connect(function(player)
- updateHeadSize(player)
- player.CharacterAdded:Connect(function()
- updateHeadSize(player)
- end)
- end)
- workspace.ChildAdded:Connect(function(child)
- if child:IsA("Model") and child:FindFirstChild("Head") then
- local head = child.Head
- changeHeadSize(head)
- end
- end)
- workspace.ChildRemoved:Connect(function(child)
- if child:IsA("Model") and child:FindFirstChild("Head") then
- local head = child.Head
- newSizes[head] = nil
- end
- end)
- userInputService.InputBegan:Connect(function(inputObject, gameProcessedEvent)
- if gameProcessedEvent then return end
- local keyCode = inputObject.KeyCode
- if keyCode == Enum.KeyCode.Q then
- settings.headScale = Vector3.new(12, 12, 12)
- checkHeads()
- elseif keyCode == Enum.KeyCode.F then
- settings.headScale = Vector3.new(7, 7, 7)
- checkHeads()
- elseif keyCode == Enum.KeyCode.Z then
- settings.headScale = Vector3.new(1, 1, 1)
- checkHeads()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement