Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make this appear for every player on the leaderboard?

Asked by
ultrabug 306 Moderation Voter
11 years ago

I have this script, but the stats only appear for the first person to join, by this I mean the 1st person to join gets their stats on the leaderboard but the others just have blank spots. How can I fix this? Here is my code.

01local ds=game:GetService("DataStoreService"):GetDataStore("Stats")
02game.Players.PlayerAdded:connect(function(np)
03    local ls=Instance.new("BoolValue")
04    ls.Name="leaderstats"
05    local level=Instance.new("NumberValue")
06    level.Name="Level"
07    local xp=Instance.new("NumberValue")
08    xp.Name="XP"
09    xp.Parent=ls
10    local kills=Instance.new("NumberValue")
11    kills.Name="Kills"
12    kills.Parent=ls
13    level.Parent=ls
14    ls.Parent=np
15    kills.Value=0
View all 54 lines...

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
11 years ago

This means you made a typo somewhere around the end, that makes the script break, the only way to fix this is to look for that typo, so that it can re-enter within the function, i would suggest starting a roblox-studio server, and then joining via ALT+F7 so that you can easily find the line that the script is crashing

Ad

Answer this question