|
function CreateStats(NewPlayer)
local MainStats = Instance.new("IntValue")
MainStats.Name = "leaderstats"
MainStats.Value = 0
local PointsValue = Instance.new("IntValue")
PointsValue.Name = "Score"
PointsValue.Value = 0
PointsValue.Parent = MainStats
MainStats.Parent = NewPlayer
return MainStats
end
game.Players.ChildAdded:connect(CreateStats)
that is the script but I am having trouble adding Wins to it |
|
|
|
jode6543Join Date: 2009-06-16 Post Count: 5363 |
Create another IntValue, then parent it to leadersrats.
~Jode |
|
|
|
|
stats = {"Points", "Stat"} --Change Stat, feel free to add more.
game.Players.PlayerAdded:connect(function(p)
local l = Instance.new("Model", p)
l.Name = "leaderstats"
for _,v in pairs(stats) do
local stat = Instance.new("IntValue", l)
stat.Name = v
stat.Value = 0
end
end) |
|
lostendJoin Date: 2011-08-21 Post Count: 8265 |
local stats={
KOs={['Name']='KOs';['Type']='IntValue';};
Wipeouts={['Name']='Wipeouts';['Type']='IntValue';};--copy and paste this to add new stats. Change Name and Type to what you want.
}
game:service'Players'.PlayerAdded:connect(function(p)
main=Instance.new('IntValue',p)
main.Name='leaderstats'
for i=1,#stats do
local stat=Instance.new(stats[i].Type,main)
stat.Name=stats[i].Name
end
end) |
|
|
@cool
Overcomplicating, and by the way, :service is deprecated. |
|
|
lostendJoin Date: 2011-08-21 Post Count: 8265 |
Still works, and it is shorter than GetService. Same with :children()
And yeah, I probably did over complicate it. :P |
|
lostendJoin Date: 2011-08-21 Post Count: 8265 |
{\rtf1\ansi\ansicpg1252
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red255\green255\blue255;}
\deftab720
\itap1\trowd \taflags0 \trgaph108\trleft-108 \trbrdrt\brdrnil \trbrdrl\brdrnil \trbrdrt\brdrnil \trbrdrr\brdrnil
\clvertalt \clshdrawnil \clwWidth13420\clftsWidth3 \clmart10 \clmarl10 \clmarb10 \clmarr10 \clbrdrt\brdrnil \clbrdrl\brdrnil \clbrdrb\brdrnil \clbrdrr\brdrnil \clpadt60 \clpadl60 \clpadb60 \clpadr60 \gaph\cellx8640
\pard\intbl\itap1\pardeftab720\sl380\
IT DOESNT WORK? :O |
|
lostendJoin Date: 2011-08-21 Post Count: 8265 |
Um ignore that. |
|
|
I pasted that into a script and it did not show wipeouts and kos as it showed |
|
lostendJoin Date: 2011-08-21 Post Count: 8265 |
Output? |
|
|
@cool
It's still deprecated. |
|
|
lostendJoin Date: 2011-08-21 Post Count: 8265 |
Deprecated or not, service is shorter. |
|
|
It's still deprecated though. So don't use it. |
|
|
LacrymaJoin Date: 2010-02-15 Post Count: 22696 |
@war
let him do w/e he wants, you barely know lua yet you're trying to argue with someone else. |
|
|
|
Duel, even you must know that you shouldn't use things that are deprecated. That is basic Lua. |
|
lostendJoin Date: 2011-08-21 Post Count: 8265 |
I know I should use what I prefer. I prefer service over GetService. I'll stop using it once it stops working. |
|
|