Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
|
| 30 Sep 2014 05:05 PM |
function onPlayerEntered(newPlayer) script.Parent.Text = "Gold: " ..game.Players.newPlayer.leaderstats.Gold.Value
end
game.Players.ChildAdded:connect(onPlayerEntered)
It's supposed to display the amount of gold that a player has in a GUI.
|
|
|
| Report Abuse |
|
|
|
| 30 Sep 2014 05:15 PM |
Try using this in a LocalScript (yes, this is the entire script):
script.Parent.Text = "Gold: " ..game.Players.LocalPlayer.leaderstats.Gold.Value |
|
|
| Report Abuse |
|
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
| |
|
|
| 30 Sep 2014 05:26 PM |
| What is the output saying? |
|
|
| Report Abuse |
|
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
|
| 30 Sep 2014 05:30 PM |
leaderstats is not a valid member of Player
Yet I just checked, and when I do a test run it indeed shows up in under Player. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 30 Sep 2014 05:30 PM |
function onPlayerEntered(newPlayer)
script.Parent.Text = "Gold: " ..newPlayer.leaderstats.Gold.Value
end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
| |
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 30 Sep 2014 05:52 PM |
| Try using PlayerAdded, and then use newPlayer:WaitForChild("leaderboard"):WaitForChild("Gold").Value |
|
|
| Report Abuse |
|
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
|
| 30 Sep 2014 05:54 PM |
| So what would that look like? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 30 Sep 2014 05:58 PM |
function onPlayerEntered(newPlayer)
script.Parent.Text = "Gold: " ..newPlayer:WaitForChild("leaderstats"):WaiForChild("Gold").Value
end
game.Players.PlayerAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
| |
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
|
| 30 Sep 2014 07:04 PM |
Bump
Ugh, anyone else want to try to help? |
|
|
| Report Abuse |
|
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
| |
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
| |
|
|
| 30 Sep 2014 11:58 PM |
How about this (LocalScript)?
local stat = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Gold") script.Parent.Text = stat.Value stat.Changed:connect(function() script.Parent.Text = stat.Value end |
|
|
| Report Abuse |
|
|
Temprist
|
  |
| Joined: 28 Aug 2010 |
| Total Posts: 10060 |
|
|
| 01 Oct 2014 04:33 PM |
Still no. Whatever, I suppose I'll try again later. |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2014 05:51 PM |
I forgot a ")" sorry.
local stat = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Gold") script.Parent.Text = stat.Value stat.Changed:connect(function() script.Parent.Text = stat.Value end)
By the way, it should be in the TextLabel that is displaying the points. |
|
|
| Report Abuse |
|
|