Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is my leaderboard set up correctly?

I was wondering why this leaderboard is not working correctly? There is absolutely no error in the output, just curious.

local kill = Instance.new("IntValue") kill.Name = "Kill" kill.Parent = game.Players.LocalPlayer local WO = Instance.new("IntValue") WO.Name = "WipeOut" WO.Parent = game.Players.LocalPlayer

1 answer

✓ Accepted answer

Ok first, really annoyed about this, indent your code . Please, it is really annoying. Anyway, there are multiple problems to your script ranging from it just sitting there to it should not be in a local script. When making a leaderboard one should take into account that there are hackers out there so it needs to be put in a safe place, which is where we script the leaderstats to be put into a folder. This is what it could look like:

game.Players.PlayerAdded:connect(function(plr)-- This allows the code to be executed when a certain event takes place
    local folder = Instance.new("Folder") --This puts the Values in a secure place
    folder.Name = "leaderstats" --Has to be named this so the script knows what it is, in this case it has to be named that. Not every case
     folder.Parent = plr
    
   local kill = Instance.new("IntValue")
   kill.Name = "Kills"
   kill.Value = 0
   kill.Parent = folder

local WO = Instance.new("IntValue")
   WO.Name = "WipeOut"
   WO.Value = 0
   WO.Parent = folder
end)

This is just a basic version of a leaderboard, it can get more complicated in changing when a certain thing takes place to setting it up on a gui. Many things. If you found this helpful don't forget to give a thumbs up and accept my answer! If you have any questions please comment on my answer and I will be glad to help!

This discussion is preserved as it was. New answers, comments, and votes are closed.