So i wanna make a screen where it displays your total amount of points. I was thinking about making a part and using the billboard GUI but i dont know how to make a script so that it always displays the current amount of points without a delay
Any ideas? Any help is appreciated
Try using the built in leaderboard that roblox provides in every game
If you would like to know the basics of leaderboards, click here to find out about leaderboards and how to set up your own.
Yea but i wanna show the players their current amount of points individually not like a leaderboard with the best points and stuff like that
With some coding that’s possible with the regular leaderboard I recommend you looking on youtube for additional help
player.Points.Changed:Connect(function ()
TextLabel.Text = player.Points.Value
end)
You didn’t provide much information in this post so I’m not too sure what you’re trying to accomplish. All you really need to do is put this script into a text label.
Also, why would you want to be listing every players points onto a billboard? I don’t see why this is necessary. Players could literally just look at the leaderboard and see the players leaderstats. If that’s what you’re trying to do you could create scripts to make it so when the player is joining or leaving the game it adds and removes a frame with the players leaderstats from the billboard gui (I’m guessing by billboard gui you mean a surface gui)
If you make a screen gui with a text label you could put this script into the text label:
while wait(1) do
script.Parent.Text = game.Players.LocalPlayer.leaderstats.Points.Value
end
This is the most confusing dev forum post I have seen in a long time and I’m guessing that you are under 13 and aren’t even allowed to be on here.
sorry im new to this forum also what i was trying to say is that the game will be like 1 player per server so i just want the player to see his current total points on a screen and i dont really know how to do that
Could you send a screenshot of the script that you used to get the points setup?
He’s asking for scripts basically he doesn’t have one
Is it a text label?
If it is, you must have a leaderstats, and put this script:
game.Players.LocalPlayer.leaderstats:GetPropretyChangedSignal("YOURVALUE"):Connect(function()
script.Parent.Text = game.Players.LocalPlayer.leaderstats.YOURVALUE.Value
end)
this is more effective
local playerPoints = game.Players.LocalPlayer.leaderstats.Points
playerPoints.Changed:Connect(function()
script.Parent.Text = playerPoints.Value
end)
Insert a screen gui into starter gui and insert a text label into the screen gui then insert the local script I sent in my first reply.
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
For hiding the leaderboard, in the case you wanted a TextLabel.
local players = game:GetService("Players")
local player = players.LocalPlayer
local leaderstats = player:WaitForChild("leaderstats")
local points = leaderstats:WaitForChild("Points")
local label = script.Parent
points.Changed:Connect(function(pointsAmount)
label.Text = pointsAmount
end)
You should wait for instances to replicate to the client before attempting to index them. Additionally, don’t forget about the parameter of the .Changed
event, for ValueBase instances it represents the new value of its “Value” property.