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

I can't find BodyWidthScale, BodyDepthScale and BodyHeightScale in-game?

Asked by
oilsauce 196
5 years ago

The below code is supposed to find the BodyWidthScale, BodyHeightScale and BodyDepthScale inside the R15 Character's Humanoid. It does work in Studio, however, if I run this in a server, None of these Values are a child of Humanoid, in fact, they aren't even a descendant of the Character.

Did ROBLOX remove these Values? If they did, are there any other way to get the Scale properties of R15 Character bodies?

The script is being ran in a Server-Script.

local plrs = game:GetService("Players")
plrs.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:connect(function(char)
        local hum = char:WaitForChild("Humanoid")
        local BW = hum:WaitForChild("BodyWidthScale")
        local BH = hum:WaitForChild("BodyHeightScale")
        local BD = hum:WaitForChild("BodyDepthScale")
    end)
end)

Output:

-- Infinite yield possible on [character].Humanoid:WaitForChild("BodyWidthScale")

1 answer

Log in to vote
0
Answered by 5 years ago

They are, children of the Humanoid, and that output message is just a warning, it will always be there when you use WaitForChild. It does not break scripts. The message is just saying the script could yield indefinitely if the child were to not be found. It is nothing to worry about, because the script didn't wait too long for the child.

On a side note, :connect() is deprecated, use :Connect() instead.

0
If he's getting the message though, there is a high chance that the script /is/ actually yielding forever because it cannot find the child. This isn't always the case but a lot of the times it is. chomboghai 2044 — 5y
0
OP later commented that "print(hum.BodyDepthScale == true)" printed false, which I later commented that it did that because objects are not booleans. They are truthy, but are not true. User#19524 175 — 5y
Ad

Answer this question