Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I have the BillBoard GUI, but the text isn't changing?!?

Asked by 9 years ago

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

0
Check your hierarchy, I see that you reference 3 indexes up as the player but for gold you use 4 indexes up and that would be the game.Players. If not, any output? Lacryma 548 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

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
Ad

Answer this question