xXLiLxJXx
|
  |
| Joined: 15 Mar 2012 |
| Total Posts: 687 |
|
|
| 02 May 2014 05:14 PM |
function CreateStats(NewPlayer) local MainStats = Instance.new("IntValue") MainStats.Name = "leaderstats" MainStats.Value = 0 end
function CreateCash() local MainStats = Instance.new("IntValue") local PointsValue = Instance.new("IntValue") PointsValue.Name = "Cash" PointsValue.Value = 100 PointsValue.Parent = MainStats MainStats.Parent = NewPlayer return MainStats end
function CreateKills() local MainStats = Instance.new("IntValue") local PointsValue = Instance.new("IntValue") PointsValue.Name = "Kills" PointsValue.Value = 0 PointsValue.Parent = MainStats MainStats.Parent = NewPlayer return MainStats end
game.Players.ChildAdded:connect(CreateStats,CreateCash,CreateKills) |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 02 May 2014 05:18 PM |
| Why 3 functions? Make it 1. |
|
|
| Report Abuse |
|
|
xXLiLxJXx
|
  |
| Joined: 15 Mar 2012 |
| Total Posts: 687 |
|
|
| 02 May 2014 05:21 PM |
I am planning on adding more into each function
|
|
|
| Report Abuse |
|
|
|
| 02 May 2014 05:22 PM |
if you want to easily add more stats, use this example script from the wiki
local stats = {"Eggs", "Chickens", "Pies"} game.Players.PlayerAdded:connect(function(player) local leaderstats = Instance.new("Model", player) leaderstats.Name = "leaderstats" for _, stat in pairs(stats) do Instance.new("IntValue", leaderstats).Name = stat end end)
#nerdsunited |
|
|
| Report Abuse |
|
|