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

How do you make points that show up on a text lable on the side of the screen? [closed]

Asked by
god3030 -48
7 years ago

I never know how to make the points that show up there for example like bloxburg and work at a pizza place I want to know how to make the point lable?

0
Just so you know, this isn't a request site. Please attempt to make this yourself next time, then post your code if you run into errors/problems. awfulszn 394 — 7y

Closed as Not Constructive by hiimgoodpack, lukeb50, and abnotaddable

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
awfulszn 394 Moderation Voter
7 years ago
Edited 7 years ago

Right, I am going to assume that you have a TextLabel in a ScreenGui, and that you have leaderstats set up.

I have two variables defining the location of both the TextLabel and the Points.

local label = game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel
local points = game.Players.LocalPlayer.leaderstats.POINTS_NAME

I am connecting to the event, .Changed, this means the function will run once theIntValue has changed.

points.Changed:Connect(function()

Once the IntValue is .Changed, the Label will update itself to whatever the points.Value is equal to.

label.Text = '$'..tostring(points.Value)
end)

Full Code:

local label = game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel
local points = game.Players.LocalPlayer.leaderstats.POINTS_NAME

points.Changed:Connect(function()
label.Text = '$'..tostring(points.Value)
end)

This code should be in a localscript. Don't forget to rename POINTS_NAME to whatever the IntValue inside your leaderstats is named as. Also, if you don't want '$' in front of the total points, remove '$'.. from the script, too.

Here is how to set up leaderstats: Link

Hope this helps! Don't forget to accept my answer if this works for you, or leave a comment if you need further assistance!

0
Please do not encourage people posting these questions. While I do understand your need for quick reputation, please don't get them at the expense of the site. lukeb50 631 — 7y
Ad