|
I have a script in a textlabel, and I want to know how to make it so the text in the textlabel equals the value for one of the leaderstats in the leaderboard. |
|
|
KacperJoin Date: 2007-12-10 Post Count: 585 |
Put this in a local script in textlabel.
local v = game.Players.LocalPlayer.leaderstats.Value -- change value to whatever you want.
while true do
script.Parent.Text = ("Value: " ..v.Value)
end |
|
KacperJoin Date: 2007-12-10 Post Count: 585 |
Edit: previous version causes crash, this is good.
local v = game.Players.LocalPlayer.leaderstats.Value -- change value to whatever you want.
while true do
script.Parent.Text = ("Value: " ..v.Value)
wait(0.1)
end |
|
|
stat = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Kos")
--change this
stat.Changed:connect(function()
script.Parent.Text = ("KOS: " ..stat.Value)
end) |
|
|
@kac
my script triumphs yours!
yeah, im epic |
|
|
I put this in the localscript:
stat = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Wood")
--change this
stat.Changed:connect(function()
script.Parent.Text = ("Wood: " ..stat.Value)
end)
Yet nothing appears. |
|
KacperJoin Date: 2007-12-10 Post Count: 585 |
I use the same scripts as you posted in my game, but I was too lazy to make "Changed" method function ^_^ |
|
|
stat = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Wood")
--change this
script.Parent.Text = ("Wood: " ..stat.Value)
stat.Changed:connect(function()
script.Parent.Text = ("Wood: " ..stat.Value)
end) |
|
KacperJoin Date: 2007-12-10 Post Count: 585 |
Because u need to change the value to make it load. |
|
|
Okay, it's working, and I disabled the leaderboard, but now this script doesn't work.
script.Parent.MouseClick:connect(function(player)
if player:FindFirstChild("Stones", true).Value >= 1 then
player:FindFirstChild("Stones", true).Value = player:FindFirstChild("Stones", true).Value - 1
--my stuff happens
end
end) |
|
KacperJoin Date: 2007-12-10 Post Count: 585 |
Because it uses the leaderboard. |
|
|
Is there a way to change it so it relies on the textlabels? |
|