I have a custom third person health bar, it uses a billboard GUI and wherever the player goes, the gui goes (since it replaces the reg. health bar) The billboard is doing fine, but the TextLabel isnt changing according to the players name and money!
here is the script
script.Parent.Text = script.Parent.Parent.Parent.Name.. "- " ..script.Parent.Parent.Parent.Parent.leaderstats.gold.Value
the script is inside a textlabel, inside a billboard gui, inside the starterGUI folder. please help thank you
Easy, use a local script in the BillBoard Gui since the Billboard is a child of player local script would work. Regular scripts would work too but It's easier to get the player using local player.
local player = game.Players.LocalPlayer --LocalPlayer! while wait() do --This is an example. script.Parent.Text = player.Name.."- "..player.leaderstats.gold.Value end
Find a way to make your own script. Maybe use changed event?
This is how you do it with a regular script. You can still get the player using :GetPlayerFromCharacter()
. The only problem is that you need the hierarchy to be correct.
local player = game.Players:GetPlayerFromCharacter(script.Parent.Parent.Parent.Parent)--GetPlayerFromCharacter! --This would only work if the text label or textbox or something is in a frame in a billboard gui in the character. Not the character's head. Edit the script or the gui a little to make it work. while wait() do --This is an example. script.Parent.Text = player.Name.."- "..player.leaderstats.gold.Value end