Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I make a script where the leaderstat updates a billboardGUI above a players head?

Salutations. I am making this script for my Event Center at my establishment.

The user gets points for getting things correct during the training. This is the Points BillboardGUI: https://prnt.sc/r8s10q

I want the BillboardGUI to change when the Leaderstat is changed.

I've tried looking up how to do this for so long and can only find stuff about GUIs but not BillboardGUIs.

Please help if you know! Any answers will help!

1 comment

0

can you send the leaderstats code pls

1 answer

You can use GetPropertyChangedSignal() to detect a change in the leaderstat's Points value. When it changes, you will need to make the Gui's Text change as well. It would look something like this.

local GUI = --Reference your GUI here.
local leaderstats = --Reference your Leaderstats here
local Points = leaderstats:WaitForChild("Points")

Points.Value:GetPropertyChangedSignal("Value"):Connect(function() -- When the Points changes then fire the event.
	GUI.Text = Points.Value -- Set the Gui Text to the Value of the Points.
end)

7 comments

0

Adding on to this, you would have to use a server script and get the player from the character and get their points from the leaderstats.

0

for values, you don't really need to use GetPropertyChangedSignal(), the .Changed event is all you need.

0

^^^

0

It's a billboard gui not a gui.

0

you know why there's a red line? cause you didn't define the variable above, dummy.

0

As they stated, you can also use .Changed. I didn't say .Changed because I haven't worked with it much, I don't use it very often. Anyway, you must define the variables yourself because we don't have any information about where they are..

This discussion is preserved as it was. New answers, comments, and votes are closed.