Your Expert
Roblox Coding Partner
PlayerSetup.lua
local Players = game:GetService("Players")
-- RoCode: Initialize new player stats
Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local coins = Instance.new("IntValue")
coins.Name = "Coins"
coins.Value = 100 -- Starting bonus!
coins.Parent = leaderstats
print(player.Name .. " joined the adventure!")
end)