Hello, I don’t understand what currentplayer is, or any of the last part of the script for that matter. The devhub keeps introducing new things and its hard to keep up
local function onPlayerAdded(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local points = Instance.new("IntValue")
points.Name = "Points"
points.Value = 0
points.Parent = leaderstats
while true do
local playerlist = Players:GetPlayers()
for currentplayer = 1, #playerlist do
local player = playerlist[currentplayer]
local points = player.leaderstats.Points
points.Value = points.Value + 1
Is currentplayer a variable which has been declared IN the for loop? can you even do that
currentplayer is the name given by to whoever wrote that code for the ilerator return of a for loop. In this case, this for loop is an incremental loop going from 1 to the amount of players in the game, used to do a specific thing in this case.
for loops follow this guideline
for (variablename) = (starting number), (ending number) do
You can name the variable anything you want, most people call it i