Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a player grow when they join?


local Plr = game:GetService("Players")
local LocalPlr = Plr.LocalPlayer
local Humanoid = LocalPlr.Character or LocalPlr.CharacterAdded:Wait()
repeat wait() until Humanoid:FindFirstChild("Humanoid")

local BodyDepthScale = Humanoid:WaitForChild("BodyDepthScale")
local BodyWidthScale = Humanoid:WaitForChild("BodyWidthScale")
local Properties = {"BodyDepthScale","BodyWidthScale"}

local Scale = 1

for _, v in pairs(Properties) do
	Humanoid[v].Value = Humanoid[v].Value + Scale
	end
	


It is a local script located in StarterPlrCharacterScripts

1 comment

0

Why do you have the in pairS looP? It sEems unneccessary so Do explain.

2 answers

✓ Accepted answer

Put this script into ServerScriptService the explanation is inside the code as you can see.

local multiplier = 2 -- the multiplier is 2 so the body will grow 2x

game.Players.PlayerAdded:Connect(function(plr) -- when player joins
	plr.CharacterAdded:Connect(function(char) -- when a character gets added
		local hum = char:WaitForChild("Humanoid") -- gets humanoid of new character
		hum.BodyHeightScale.Value = multiplier -- changes height
		hum.BodyWidthScale.Value = multiplier -- changes width
		hum.BodyDepthScale.Value = multiplier -- changes depth
		hum.HeadScale.Value = multiplier -- changes headsize
		hum.WalkSpeed = multiplier*16 -- changes walkspeed accordingly
		hum.JumpPower = multiplier*50 -- changes jumppower accordingly
		-- feel free to remove any stuff like depth and width and head to make the person only grow and stuff
		-- you can also do like 2*multiplier to make it grow even 2x the multiplier on some values
	end)
end)

Hi, You would make a function my friend. It should be something like this:

function playerJoin()

--Code here, also code that changes player size

end

game.Players.PlayerAdded:Connect(playerJoin) -- Connect the function with an event called on playeradded.

This would run every time a player joins and also if this is a local script only the player can see it and no one else can. You can also double check if the functions runs by typing in print statement called print("A player has joined"). It should print in the output window that a player has joined.

1 comment

0

You'd need CharacterAdded, because when the player resets, the size reverts.

This discussion is preserved as it was. New answers, comments, and votes are closed.