Alend43Join Date: 2013-11-13 Post Count: 451 |
title |
|
orange451Join Date: 2008-08-21 Post Count: 580 |
game.Players.LocalPlayer.leaderstats |
|
|
game.Players.LocalPlayer.leaderstats
?? |
|
dj7679Join Date: 2013-06-11 Post Count: 307 |
Use a local script
--In local script
player = game.Players.LocalPlayer
leaderboard = Instance.new("IntValue",player)
leaderboard.Name = "leaderstat" -- This name is required
--In any other script
game.Players.PlayerAdded:connect(function(player)
playerleaderstat = player.leaderstat
end)
Not 100% sure its correct but you can test it out to see. |
|
Alend43Join Date: 2013-11-13 Post Count: 451 |
I just want to know what to put in a script to Find the leaderstats. I already have the leaderstats. |
|
Em_ilyJoin Date: 2014-01-21 Post Count: 1708 |
:FindFirstChild('leaderstats') |
|
Alend43Join Date: 2013-11-13 Post Count: 451 |
Ok, I have this
local player = game.Players.LocalPlayer
local cash = player:FindFirstChild("leaderstats"):WaitForChild("Cash")
It says on local cash, Im trying to index a nil value. Which value is the nil 1? |
|
Em_ilyJoin Date: 2014-01-21 Post Count: 1708 |
Probably Cash, do you have a Value for Cash in another script? |
|
Em_ilyJoin Date: 2014-01-21 Post Count: 1708 |
Ah, and use a local script. |
|
|
try using :waitforchild for both of them instead of having the first one be :findfirstchild |
|
Alend43Join Date: 2013-11-13 Post Count: 451 |
I do have Cash in the players leaderstats, I checked
and it is in a local script .-. |
|
dj7679Join Date: 2013-06-11 Post Count: 307 |
game.Players.PlayerAdded:connect(function(player)
leaderboard = Instance.new("IntValue",player)
leaderboard.Name = "leaderstat"
cash = Instancenew("IntValue",leaderstat)
cash.Name = "Cash"
end)
This should run fine. You have to parent cash to the leaderstat. |
|
Alend43Join Date: 2013-11-13 Post Count: 451 |
Yes thank you, Using wait for child for both of them worked! |
|