Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a transfer leaderstats command?

Asked by
H34E7R 19
6 years ago

I would like to be able to transfer leaderstats from one person to another. For example the person could be able to type in chat: /transfer coins(leaderstat value) H34E7R(the player they're sending it to) 1000(amount).

I will send my leaderstat script.

01local currencyName = "Coins"
02local DataStore = game:GetService("DataStoreService"):GetDataStore("TestDataStore")
03game.Players.PlayerAdded:Connect(function(player)
04 
05    local folder = Instance.new("Folder")
06    folder.Name = "leaderstats"
07    folder.Parent = player 
08 
09    local currency = Instance.new("IntValue")
10    currency.Name = currencyName
11    currency.Parent = folder
12 
13    local ID = currencyName.."-"..player.UserId
14    local savedData = nil  
15 
View all 43 lines...

Answer this question