0 views0 copies0 likes
Coin Leaderstats from Player Attributes
Universal script
Copy it, then test it in your own Studio place.
Script code
18 lines ยท 0.6 KBlocal Players = game:GetService("Players")local function bind(player) local stats = player:FindFirstChild("leaderstats") if not stats then stats = Instance.new("Folder", player) stats.Name = "leaderstats" end local coins = stats:FindFirstChild("Coins") if not coins then coins = Instance.new("IntValue", stats) coins.Name = "Coins" end local function sync() coins.Value = math.floor(player:GetAttribute("Coins") or 0) end player:GetAttributeChangedSignal("Coins"):Connect(sync)-- โฆopen Get script for the full sourceAbout this script
Use this server Script to display your session Coins attribute on Roblox's player list. It creates or reuses the leaderstats folder, then updates its Coins IntValue whenever the attribute changes. Other systems can award points by writing the attribute, while this script handles display only. Test a new player and an existing coin pickup together to check that the display follows each award.
Log in to leave a comment.
No comments yet
Be the first to share your thoughts!
Comments
Share what works, ask questions, or report an issue.