Skip to content

Instantly share code, notes, and snippets.

View TorchiDev's full-sized avatar

Torchi TorchiDev

View GitHub Profile
@TorchiDev
TorchiDev / leaderstats.lua
Created April 30, 2026 18:07
Datastore and leaderstats code of my roblox game "Plot Wars"
local DataStoreService = game:GetService("DataStoreService")
local MyDataStore = DataStoreService:GetDataStore("PlayerSave_V15") -- published to public version : v15
local BuyRemote = game.ReplicatedStorage.BuyTool
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder", plr)
leaderstats.Name = "leaderstats"
local coins = Instance.new("IntValue", leaderstats)
coins.Name = "Coins"