Player shrink/growth script issue

Hi everyone, I’m trying to get a script to work that initially shrinks the player down to small scale size and slowly gets them back up to size and then some (basically experimenting with infinite character size growth) but I’m having trouble trying to call for the humanoid instance. Pretty sure I made a simple mistake but I can’t really find out how to solve it myself:

game.Players.PlayerAdded:Connect(function(plr)
	local noid = plr.Character:WaitForChild("Humanoid") -- getting indexed as nil
	if noid ~= nil then
		
		local HS = noid.HeadScale
		local BDS = noid.BodyDepthScale
		local BWS = noid.BodyWidthScale
		local BHS = noid.BodyHeightScale
		
		HS.Value = HS.Value * 0.1
		BDS.Value = BDS.Value * 0.1
		BWS.Value = BWS.Value * 0.1
		BHS.Value = BHS.Value * 0.1
		while true do
			wait(0.1)
			HS.Value = HS.Value * 0.01
			BDS.Value = BDS.Value * 0.01
			BWS.Value = BWS.Value * 0.01
			BHS.Value = BHS.Value * 0.01
		end
	end
end)

Any help would be appreciated

1 Like

plr.Character isn’t available immediately as the Player arrives first, so wait for the plr.CharacterAdded() event and connect a function to that, something like:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local noid = char:WaitForChild("Humanoid")
	end)
end)
1 Like