Im trying to add a GUI above an NPC using a billboard gui. Customer is what the NPC is named. For some reason, the g.Adornee is not being set when I check properties while testing.
c = game.ServerStorage.Customer:Clone()
c.Parent = game.Workspace
c.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(5.549, 0.031, 9.458))
human = c:WaitForChild("Humanoid")
torso = c:WaitForChild("Torso")
head = c:WaitForChild("Head")
g = game.StarterGui.BillboardGui:Clone()
g.Adornee = head
print(g.Adornee)
This prints “Head”
Sorry for the undescriptive variable names im kinda a noob to scripting.
I don’t think you set an Adornee on a BillboardGui, I certainly don’t.
I would recommend moving the BillboardGui into ServerStorage then clone it from there. Then set the Parent to head:
g = game.ServerStorage.BillboardGui:Clone()
g.Parent = head
Launch in Studio then in Explorer navigate to the NPC and you should see the BilboardGui parented there.