game.players.playerAdded:connect(function(plr) local stats =Instance.new("Folder"), plr) stats.name = "leaderstats"
local coins = Instance.new("IntValue"), stats) Coins.name = "Coins" Coins.value = 0
end)
in LuaU coding, everything is case sensitive. It has to be Players, not players and it has to be PlayerAdded, not playerAdded. It's a bit annoying but you will get used to it.
so here is your script but fixed.
1 | game.Players.PlayerAdded:Connect( function (plr) |
2 | local stats = Instance.new( "Folder" ,plr) |
3 | stats.Name = "leaderstats" |
4 |
5 | local coins = Instance.new( "IntValue" ,stats) |
6 | coins.Name = "Coins" |
7 | coins.Value = 0 |
8 | end ) |