0% found this document useful (0 votes)
25 views2 pages

Message

This script allows a player in a game to increase their character's size by pressing the 'P' key, scaling all parts uniformly while maintaining specific size ratios for key body parts. It includes a maximum size limit and resets the scale upon character respawn. Additionally, it adjusts the humanoid's movement properties based on the new scale to ensure consistent gameplay experience.

Uploaded by

galxayplays77
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Message

This script allows a player in a game to increase their character's size by pressing the 'P' key, scaling all parts uniformly while maintaining specific size ratios for key body parts. It includes a maximum size limit and resets the scale upon character respawn. Additionally, it adjusts the humanoid's movement properties based on the new scale to ensure consistent gameplay experience.

Uploaded by

galxayplays77
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

local player = game.Players.

LocalPlayer
local UserInputService = game:GetService("UserInputService")

local sizeMultiplier = 1.2 -- Multiplies size by this amount each press (20%
bigger)
local maxSize = 10 -- Optional max scale limit (set to nil for no limit)
local currentScale = 1 -- Tracks overall scale (starts at default size)

-- Function to increase character size uniformly


local function growCharacter()
local character = player.Character
if not character then
warn("Character not found!")
return
end

local humanoid = character:FindFirstChild("Humanoid")


if not humanoid then
warn("Humanoid not found!")
return
end

-- Calculate new scale


currentScale = currentScale * sizeMultiplier
if maxSize and currentScale > maxSize then
currentScale = maxSize
end

-- Scale all parts uniformly, including head


for _, part in pairs(character:GetDescendants()) do
if part:IsA("BasePart") then
-- Define original sizes for key parts
local originalSize = Vector3.new(1, 1, 1) -- Default for most parts
if part.Name == "HumanoidRootPart" then
originalSize = Vector3.new(2, 2, 1) -- R15 root default
elseif part.Name == "Head" then
originalSize = Vector3.new(1.25, 1.25, 1.25) -- Adjusted R15 head default
elseif part.Name == "UpperTorso" or part.Name == "LowerTorso" then
originalSize = Vector3.new(2, 1, 1) -- R15 torso defaults
end

part.Size = originalSize * currentScale


end
end

-- Sync head scale with humanoid properties for consistency


humanoid.HeadScale.Value = currentScale

-- Update movement properties


humanoid.WalkSpeed = 16 * currentScale
humanoid.JumpPower = 50 * currentScale

print("Character scaled to: " .. currentScale)


end

-- Handle character respawn


local function onCharacterAdded(newCharacter)
currentScale = 1 -- Reset scale on respawn
print("Character loaded!")
end

player.CharacterAdded:Connect(onCharacterAdded)
if player.Character then
onCharacterAdded(player.Character)
end

-- Detect "P" key press


UserInputService.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.P and not gameProcessed then
print("P pressed!")
growCharacter()
end
end)

You might also like