|
| 10 Jul 2014 01:03 PM |
I am making stats for my game first adding the leader boards then plan to make it show the stats on another gui. but i can not figure out two things how to add multiple leader stats i'm adding ki agility and attack and how to make it show on another gui. this is the code i'm using currently.
function playerAdded(plr)
local stats = Instance.new("IntValue", plr) stats.Name = "leaderstats"
local Ki = Instance.new("IntValue", stats) Ki.Name = "Ki" Ki.Value = 100 end
game.Players.PlayerAdded:connect(playerAdded) |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 10 Jul 2014 01:08 PM |
| whats with everyone doing ki agility and attack |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2014 01:10 PM |
Smiley me and team are brothers, he and I are working on dbz games, (seperate of course) and from the help of smiley, on the other thread he halped me on, uhh I think it was him XD
heres my code I use, atleast I do now XD Data=game:GetService("DataStoreService"):GetDataStore("Stats")--change points to whatever local stats = {"Ki", "Physical", "Agility"}
game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("Model", player) leaderstats.Name = "leaderstats" for _, stat in pairs(stats) do a=Instance.new("IntValue", leaderstats) a.Name = stat a.Value=Data:GetAsync(player.userId..stat) a.Changed:connect(function(value) Data:SetAsync(player.userId..stat,value) end) end end) |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2014 01:11 PM |
| Well i'm making those for my dbz game. but soon as i get those working and the gui etc i might be adding a few other stats. |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 10 Jul 2014 01:12 PM |
it was me ye i see well ye that^ |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2014 01:16 PM |
| Rock i put the code in my leaderstats script in workspace and it did not work lol. |
|
|
| Report Abuse |
|
|