|
game.Players.PlayerAdded:connect(function(player)
stats = Instance.new("IntValue", player)
stats.Name = "leaderstats"
Points = Instance.new("IntValue", leaderstats)
Points.Name = "Points"
Points.Value = 0
asdf = Instance.new("IntValue", leaderstats)
asdf.Name = "Total Points"
asdf.Value = 0
end)
|
|
|
|
--Try:
game.Players.PlayerAdded:connect(function(player)
stats = Instance.new("IntValue")
stats.Name = "leaderstats"
Points = Instance.new("IntValue", stats)
Points.Name = "Points"
Points.Value = 0
asdf = Instance.new("IntValue", stats)
asdf.Name = "Total Points"
asdf.Value = 0
stats.Parent = player
end) |
|
|
output? What do you see? What do you not see? |
|
|
No output and @XX didn't work |
|
|
What do you see? What do you not see? |
|
|
@Pre Nothing, thats why I bothered to reply again |
|
EgoMooseJoin Date: 2009-02-04 Post Count: 2896 |
You need to let the character load first.
game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character ~= nil
stats = Instance.new("IntValue", player)
stats.Name = "leaderstats"
Points = Instance.new("IntValue", stats)
Points.Name = "Points"
Points.Value = 0
asdf = Instance.new("IntValue", stats)
asdf.Name = "Total Points"
asdf.Value = 0
end) |
|
|
|
I don't understand why mine didn't work.
Where is the script located? |
|
|
|
I've tried that before, strangely those scripts broke. I used a free model, copy/pasted the source code into another script and the new one didn't work. I'd just find a free model, fresh ones broke for some reason. And yes, I hate using free models too. |
|
EgoMooseJoin Date: 2009-02-04 Post Count: 2896 |
What type of script are you using? |
|
|
|
-- I gave it another try, this is how I would do it
function OnEnter(plr)
stats = Instance.new("IntValue")
stats.Name = "leaderstats"
p = Instance.new("NumberValue")
p.Name = "Points"
p.Value = 0
p.Parent = stats
a = Instance.new("NumberValue")
a.Name = "Total Points"
a.Value = 0
a.Parent = stats
stats.Parent = plr
game.Players.PlayerAdded:connect(OnEnter) |
|
EgoMooseJoin Date: 2009-02-04 Post Count: 2896 |
Hmm, well then it should be working.
You could try increasing the yield time. I think in the standard roblox leaderboards they wait 5 seconds.
As a side note, I know mine works I tested it before I posted it. So now it's just a matter of why it isn't working for you :D |
|
|
|
game.Players.PlayerAdded:connect(function(player)
local stats = Instance.new("Model", player)
stats.Name = "leaderstats"
local points = Instance.new("IntValue", stats)
points.Name = "Points"
points.Value = 0
end)
Regular script; place in Workspace.
You had the actual stats good, but not the leaderstats object.
Add more stats the way you were the ones you had. leaderstats is a Model.
Make sure you are using the right value. ie, StringValue, IntValue. Don't know if you can use BoolValue in leaderstats... |
|
|
Xx, that's very inefficient. |
|
|
@Mod
Well I am old school |
|
|
@Xx lol not sayin it's bad, it's just a little bit slower and sloppier. |
|