|
| 25 Jul 2014 01:20 PM |
| I've done a bit of searching on google and couldn't seem to find out how to make it so theres another cateogry. I'm making a tycoon and I'm trying to figure out how to make a row that says Cash in the Player List. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 01:22 PM |
stats = {"Score", "Wins"} --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)
|
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 01:23 PM |
| you can add more or edit them |
|
|
| Report Abuse |
|
|
MHebes
|
  |
| Joined: 04 Jan 2013 |
| Total Posts: 2278 |
|
|
| 25 Jul 2014 01:23 PM |
http://lmgtfy.com/?q=roblox+player+list+cash
Second result dude. |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 01:27 PM |
| Was wondering what are the p's for like function(p) |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 03:03 PM |
| Bump nvm about the function questioned I was just being dumb. But where do I put this script into? |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 25 Jul 2014 03:05 PM |
@Leg y u no
local Stats = { {"Int", "Test1", 1}, {"Int", "Test2", 2}, {"String", "rank", "swag"} }
function newPlayer(Player) local leaderstats = Instance.new("IntValue") leaderstats.Name = "leaderstats" for _, x in pairs (Stats) do local Stat = Instance.new(x[1] .. "Value") Stat.Name = x[2] Stat.Value = x[3] Stat.Parent = leaderstats end leaderstats.Parent = Player end
Game.Players.PlayerAdded:connect(newPlayer) |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 03:07 PM |
| Thanks so much for the reply, but where do I put the script. Like in the workspace or what? Sorry I'm so beginner at scripting :( |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 03:09 PM |
| Lol derp okay it works when I just put in worksapce. Is there any benefit in using urz instead of Legs, 128? Cuz legs seems more simple. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 25 Jul 2014 03:12 PM |
You can put it in workspace but serverscriptstorage is better
Benifits of mine
local Stats = { {"Int", "Test1", 1}, {"Int", "Test2", 2}, {"String", "rank", "swag"} }
You can set the type of value (Int, String, Number) Int means a non decimal number String is words Number is any number
You can set the name (Like in his)
And set the value it starts at
Example
local Stats = { {"Int", "Gold", 100}, {"Int", "Money", 50} }
Will make them start with 100 Gold, and 50 Money |
|
|
| Report Abuse |
|
|
|
| 25 Jul 2014 03:22 PM |
Ah okay thanks 128. Just for knowledge sakes, could you help me understand the lines i put -- next to?
stats = {"Money"} game.Players.PlayerAdded:connect(function(p)-- is function(p) some default thing? local l = Instance.new("Model", p) -- is this creating a model, and is the p the name for it or something? also why is it creating a model for. l.Name = "leaderstats" -- why do you need to name it is for _,v in pairs(stats) do -- i know what for loops are but this is weird cuz normally is like for i = 1, < 10, ++ or atleast thats how it is in java. i dont get the syntax in this certain one. local stat = Instance.new("IntValue", l) stat.Name = v -- not sure why you gotta name this cuz I thought its already named as Money. stat.Value = 0 end end) |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 25 Jul 2014 03:24 PM |
| Oh and also Legs script doesn't work |
|
|
| Report Abuse |
|
|