Hey guys,
The example given on developer.roblox.com is as follows
local player = game:GetService("Players").LocalPlayer
local character = player.Character or
player.CharacterAdded:wait()
local humanoid
while not humanoid do
humanoid =
character:FindFirstChildOfClass("Humanoid")
if not humanoid then
character.ChildAdded:wait()
end
end
Is it absolutely necessary to check for
while not humanoid do
humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then
character.ChildAdded:wait()
end
end
as wouldn’t all the children of character already already be available from this line?
local character = player.Character or player.CharacterAdded:wait()
How about just doing this?
local humanoid = character:FindFirstChildOfClass("Humanoid")