Stonixx
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2781 |
|
|
| 13 Jul 2014 11:58 AM |
I have the leaderstats script, but I'm not too sure how to apply it to tools. Leaderstatats script:
local ds = game:GetService("DataStoreService"):GetDataStore("stats") stats={"Lvl","XP","Gold"} game.Players.PlayerAdded:connect(function(plyr) local a=Instance.new("NumberValue") a.Parent=plyr a.Name="leaderstats" for i=1,#stats do local stat=Instance.new("NumberValue") stat.Parent=a stat.Value=0 stat.Name=stats[i] end local child=plyr.leaderstats:GetChildren() for i=1, #child do child[i].Value=ds:GetAsync(plyr.userId..child[i].Name) end end)
game.Players.PlayerRemoving:connect(function(plyr) local child=plyr.leaderstats:GetChildren() for i=1, #child do child[i].Value=ds:SetAsync(plyr.userId..child[i].Name,child[i].Value) end end)
Someone help me apply this to tools? Ty.
|
|
|
| Report Abuse |
|
|
| 13 Jul 2014 12:09 PM |
| You can't save instances. Just save numbers so you know which tool it is. |
|
|
| Report Abuse |
|
Stonixx
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2781 |
|
| |