In the past, the script I made to give a player a BillboardGui worked, but suddenly it seems to have broken on all the games I use it on. The issue appears to be with getting the Character’s Head.
Of course, I grab the Character via Player, and the Character’s Head, and assign head to nameGui.
local char = plr.Character or plr.CharacterAdded:Wait()
local head = char.Head
local nameGui = head:FindFirstChild("BioGui")
But the line of issue (17) is:
local nameLabel = nameGui:FindFirstChild("BioLabel")
which returns:
ServerScriptService.ChangeNameScript:17: attempt to index nil with 'FindFirstChild'
in the Output.
This has never happened before with this script and it used to work perfectly. To double check if Head was still parented to Character, I went to my test dummy and found that it was still the case, and checked the Developer reference site, to the same answer…
Have things formerly parented to Character been moved, or has the plr shorthand been deprecated? That’s the only reason I can come up with for these things no longer working.
For further clarification though it really shouldn’t matter because the new version of the script (above) does the same exact thing, the old version of this script didn’t create a call for head at all and just called char.Head straight up. Of course this was broken as well, implying the issue appear to be with char.Head.
local char = plr.Character or plr.CharacterAdded:Wait()
local nameGui = char.Head:FindFirstChild("BioGui")
local nameLabel = nameGui:FindFirstChild("BioLabel")
nameGui is returning nil. Not head. If head were nil you would get an error where you define nameGui. This means BioGui is not parented to the player’s head when you call it.
when do you parent it? I’m assuming that these scripts aren’t coordinating with one another. The first script could be trying to get the biogui before the other has parented it
When the player wants to change the text on this it will send the info via RemoteEvent after the player clicks on the confirm button.
Don’t understand how this could unsync…
This works perfectly fine on an older game of mine still. Hm.