I am trying to make a custom third person health bar (other people see it) I have it so that it makes the local players head the Adornee, which would then put the billboard gui above the players head... But it's saying that "player is not a valid member of Workspace"
Local player = game.Players.LocalPlayer:GetFullName() script.Parent.Adornee = script.Parent.Parent.Parent.Parent.Parent.Workspace.player.Head
Please help Thank you!
That is not a syntax error.
A syntax error is when you are syntactically invalid -- that is, it doesn't care what you wrote, the "grammar" of it is wrong.
The error you're getting is a run time error -- an error that happens after the script starts running (it can't start running if it doesn't understand you -- a syntax error)
First: local
must be lowercase.
:GetFullName()
is not usually useful for scripts (i.e., it's only useful to humans). If you want a reference to an object, just use object itself, e.g.,
local player = game.Players.LocalPlayer
Now we want the player's Character. That will simply be
local character = player.Character
However, the Character won't load immediately. A simple way to do it is to wait()
until
you it's there:
repeat wait() until player.Character local character = player.Character
A more terse way to write it is
local character = player.Character or player.CharacterAdded:wait()
Now the character
's Head is simply character.Head
Though it might be safer to wait for it to be there, hence, we could use
local head = character:WaitForChild("Head") script.Parent.Adornee = head