#How do I make a score system

1 messages · Page 1 of 1 (latest)

gritty lotus
#

Im very new to lua code and I want to start from the basis of it. Im trying to understand the code of other's people by code analysis, yet I still dont understand it.

game.Players.PlayerAdded:connect(function(player)

local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player

local coins = Instance.new("NumberValue")
coins.Name = "Coins"
coins.Parent = leaderstats

end)

Can you please explain to me how this works, because I simply dont understand the majority of it

golden matrix
#

leaderstats lets you display values on the roblox leaderboard

round marten
#

basically it detects when the player is added or joins the game in the first line

#

creates a folder and names it "leaderstats" then puts it inside player in the next 3 lines

#

then in the next 3 lines creates a numbervalue which can store number and names it "Coins" then puts it in leaderstats or the folder it created earlier

gritty lotus
radiant elk
gritty lotus
radiant elk
# gritty lotus Ohhh ok, thank you for explaining that to me

np, and do pay notice to that fact - anything you can do manually in the explorer, like if you press play then start messing about with things like changing your walkspeed to be very high so you run fast, code can do that too. it's like recording a bunch of manual steps you've made into the script, and the script will repeat those steps very fast.

gritty lotus