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

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

Asked by
ghxstlvty 133
4 years ago

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!

0
can you send the leaderstats code pls royaltoe 5144 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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)
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. killerbrenden 1537 — 4y
0
for values, you don't really need to use GetPropertyChangedSignal(), the .Changed event is all you need. LeadRDRK 437 — 4y
0
^^^ royaltoe 5144 — 4y
0
It's a billboard gui not a gui. ghxstlvty 133 — 4y
View all comments (3 more)
0
you know why there's a red line? cause you didn't define the variable above, dummy. 0msh 333 — 4y
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.. JoyfulPhoenix 139 — 4y
Ad

Answer this question