I’ve used the same set of scripts for my roleplay games to give the players customizable names and bios for a while. Suddenly, today, they broke and return attempt to index nil with FindFirstChild
.
There are multiple of these scripts that work in tandem, but the only two that matter are GiveTitle and ChangeScript.
GiveTitle:
This gives the player the BillboardGui that their name and bio will be in.
local Players = Game:GetService("Players")
local function OnPlayerAdded(Player)
local function OnCharacterAdded(Character)
if not Player:HasAppearanceLoaded() then
Player.CharacterAppearanceLoaded:Wait()
end
local Head = Character:WaitForChild("Head")
local nameGui = Instance.new("BillboardGui")
nameGui.StudsOffset = Vector3.new(0, 3, 0)
nameGui.Size = UDim2.new(0, 200, 0, 50)
nameGui.Name = "BioGui"
nameGui.Adornee = Head
nameGui.Parent = Head
nameGui.MaxDistance = 100
local nameLabel = Instance.new("TextLabel")
nameLabel.Text = " "
nameLabel.TextScaled = true
nameLabel.TextWrapped = true
nameLabel.Size = UDim2.new(.5, 100, 0, 25)
nameLabel.BackgroundTransparency = 1
nameLabel.TextColor3 = Color3.new(255, 255, 255)
nameLabel.Font = 13
nameLabel.TextStrokeColor3 = Color3.new(0, 0, 0)
nameLabel.TextStrokeTransparency = .5
nameLabel.Name = "BioLabel"
nameLabel.Parent = nameGui
end
Player.CharacterAdded:Connect(OnCharacterAdded)
end
Players.PlayerAdded:Connect(OnPlayerAdded)
ChangeTitle:
This changes the text of the BillboardGui above to whatever the player inputs.
remoteEvent.OnServerEvent:Connect(function(plr, name)
local char = plr.Character or plr.CharacterAdded:Wait()
local filteredName = game:GetService("TextService"):FilterStringAsync(name, plr.UserId)
local filteredNameAsString = filteredName:GetNonChatStringForBroadcastAsync()
local nameGui = char.Head:FindFirstChild("BioGui")
local nameLabel = nameGui:FindFirstChild("BioLabel")
nameLabel.Text = filteredNameAsString
end)
This worked perfectly fine yesterday! Changing FindFirstChild to WaitForChild didn’t work either, instead returning Infinite yield possible on 'Workspace.ControlCoreAngel.Head:WaitForChild("BioGui")
, implying BioGui never gets made to begin with.
I suspect Roblox updating broke my stuff again. Help’s appreciated, I don’t see how this isn’t working.