Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I make a player grow when they join?

Asked by 3 years ago

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

0
Why do you have the in pairS looP? It sEems unneccessary so Do explain. abstractedfrostbite 110 — 3y

2 answers

Log in to vote
0
Answered by
sayer80 457 Moderation Voter
3 years ago

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)

Ad
Log in to vote
-2
Answered by 3 years ago

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.

0
You'd need CharacterAdded, because when the player resets, the size reverts. sayer80 457 — 3y

Answer this question