So I made a simple script that is meant to shrink a players avatar once they join the game, but when I run it I get an error telling me it can't find the players humanoid, I've tried finding the humanoid with 4 different methods and the script can find the players username easily, if anyone could point out what I've done wrong I would greatly appreciate it!
function PlayerSize(player)
local SizeValue = 0.6
local Character = player.Character
print(player)
local humanoid = Character.Humanoid
if humanoid then
print("humanoid found")
if humanoid:FindFirstChild("BodyHeightScale") then
humanoid.BodyHeightScale.Value = SizeValue
end
if humanoid:FindFirstChild("BodyWidthScale") then
humanoid.BodyWidthScale.Value = SizeValue
end
if humanoid:FindFirstChild("BodyDepthScale") then
humanoid.BodyDepthScale.Value = SizeValue
end
if humanoid:FindFirstChild("HeadScale") then
humanoid.HeadScale.Value = SizeValue
end
end
end
wait(2)
for i, player in pairs(game.Players:GetPlayers()) do
PlayerSize(player)
end

1 comment
I think you havnt found the declared the player the script