Why is char.Head returning as nil?

Just start the game and check if at all the head and guis exist using the explorer

theres no way you’re still getting the same error msg. If nameGui was nil youd get a different error saying theres an infinite loop. If you are still getting the same exact error msg then either line 17 is different than what you sent or nameGui is getting deleted

I sure exist and my Head sure exists. However, BioGui didn’t appear to parent to my Head…

But the script I posted here should parent it just fine, right?

no i know whats happening. You make the connection to player added but by the time you make those connections either the player loaded in before playerAdded is connected, or the char is added before CharAdded is connected. You should check if the player is already loadedd in.

you can test by printing inside of each connection to see when and if its firing

Thanks Roblox, very cool.
How do I fix this?

depends on if this is a local script or a server script

Both server scripts. Adding the print tests work and the player and its character connect as normal.

Starting to think this is another Roblox-ended bug… Certainly not the first time that’s happened to me.

oh well in that case you are somehow deleting bioGui

are there any scripts that reparent it or delete it?

No. Apparently, it fails to create itself (renamed or not) entirely, if the lack of it in Explorer is anything to go by.

Meaning our error now lies with:

local nameGui = Instance.new("BillboardGui")

you can test that theory by printing print(nameGui.Name) at the end of the Character Added function. I dont think thats the issue though.

Think I’ll make a new thread for this, now that the problem is a bit different.

EDIT: Take two.

I’ll post the solution here too.

May I know where this script is placed?

The character is not fully initialized during the first frame of its existence. A simple fix is to add task.wait() or RunService.Stepped:wait() to wait at least one frame after the character model has been created.

The resulting code would look something like this:

local char = plr.Character or plr.CharacterAdded:Wait()
task.wait()
local head = char.Head
local nameGui = head:FindFirstChild("BioGui")