โ† Back to all scripts

Leaderstats Setup

Create a leaderboard with Cash and Level values that appear above every player's head.

LeaderstatsBeginnerServerScriptService
leaderstats-setup.lua
-- Leaderstats Setup
-- Place in ServerScriptService

game.Players.PlayerAdded:Connect(function(player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    local cash = Instance.new("IntValue")
    cash.Name = "Cash"
    cash.Value = 0
    cash.Parent = leaderstats

    local level = Instance.new("IntValue")
    level.Name = "Level"
    level.Value = 1
    level.Parent = leaderstats
end)
Something broken or not working?
๐Ÿ”ง Try the AI Script Fixer โ†’