Droben
|
  |
| Joined: 18 Nov 2012 |
| Total Posts: 54 |
|
|
| 20 Jul 2013 10:38 PM |
Not begging or demanding this script.
So like, can someone help make a leaderboard that says "Flags"? Player spawns with 0
|
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 10:44 PM |
local Stats = { ["Flags"] = "IntValue"; ["Random String Stat"] = "StringValue"; }
function MakeStats(Player) local p = instance.new("IntValue",Player) p.Name = "leaderstats" for o,n in pairs(Stats) do Instance.new(n,p).Name = o end end
Game.Players.PlayerAdded:connect(MakeStats) |
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 10:46 PM |
if you want it to work in play solo put this line on the bottom: for _,n in ipairs(Game.Players:GetPlayers()) do MakeStats(n) end |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
|
| 20 Jul 2013 10:50 PM |
^ That's just wrong. the pairs iterator function takes a Table as an argument not a number. |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
Droben
|
  |
| Joined: 18 Nov 2012 |
| Total Posts: 54 |
|
|
| 20 Jul 2013 10:53 PM |
Thanks, guys! But heres the difficult part
On a side note, do I insert that script into the flag model?
So, how can you make it so if a player already touched the flag, the leaderstats dont change? |
|
|
| Report Abuse |
|
|
Droben
|
  |
| Joined: 18 Nov 2012 |
| Total Posts: 54 |
|
|
| 20 Jul 2013 10:56 PM |
Is it like
ifTouched.Player.leaderstats.value ~= nil?
|
|
|
| Report Abuse |
|
|
|
| 20 Jul 2013 11:02 PM |
How about you learn how to script then come back. There are great tutorials on youtube. To to "pighead10" on youtube. |
|
|
| Report Abuse |
|
|
Droben
|
  |
| Joined: 18 Nov 2012 |
| Total Posts: 54 |
|
|
| 20 Jul 2013 11:08 PM |
| Believe me, I may not be that good, but Im not so bad that I need a repeat :p |
|
|
| Report Abuse |
|
|