of     1   

JleaY
#221330032Friday, July 14, 2017 8:41 PM GMT

So I am doing a pokedex feature for my game, this is where the Pokedex is located: game.Players.LocalPlayer.Pokedex Inside of that Pokedex (ObjectValue), are all the Pokemon's Pokedex numbers, eg: 001, 002, etc. Those 001, 002, etc. are BoolValues (so false/true) Now this is the important part (script): local Player = game.Players.LocalPlayer local Pokedex = Player.Pokedex local Number = 0 for i,v in pairs (Pokedex:GetChildren()) do if v.Value == true then ----How would I add up all the values here if they are true? (ONLY TRUE) end end #code print("Lightning Flame Dragon Mode...") --I am totally not Natsu Dragneel
Kerbodyne
#221331341Friday, July 14, 2017 8:58 PM GMT

You can't add boolean values together, but if you mean't you wanted to have an array of all the true values, you can use table.insert() Kerbodyne
yin_yang
#221331599Friday, July 14, 2017 9:02 PM GMT

use i (index) as reference to the number of boolvalues that are set to true.
JleaY
#221331770Friday, July 14, 2017 9:04 PM GMT

explain table.insert() please? #code print("Lightning Flame Dragon Mode...") --I am totally not Natsu Dragneel
JleaY
#221331797Friday, July 14, 2017 9:05 PM GMT

mind doing it for me, i only get the v in i,v #code print("Lightning Flame Dragon Mode...") --I am totally not Natsu Dragneel
yin_yang
#221332299Friday, July 14, 2017 9:12 PM GMT

basically do Number = i
edenDeden
#221332648Friday, July 14, 2017 9:17 PM GMT

try this local Player = game.Players.LocalPlayer local Pokedex = Player.Pokedex local Number = 0 table= {} for i,v in pairs (Pokedex:GetChildren()) do if v.Value == true then table.insert(table,v.Name end end print(unpck(table)) wanna read about tables then http://wiki.roblox.com/index.php?title=Table
edenDeden
#221332768Friday, July 14, 2017 9:18 PM GMT

*table.insert(table,v.Name) *print(unpack(table)) added this in just incae u couldnt figure out yourself
JleaY
#221333528Friday, July 14, 2017 9:29 PM GMT

Thanks, man! Please read this through...so lets say I got 001 and 002 in my Pokedex for now. When I set them both to true, it will print 001 002 or 002 001. Instead of this, can you make it so it adds up all of the numbers inside the table? Would mean a lot if you could do this! #code print("Lightning Flame Dragon Mode...") --I am totally not Natsu Dragneel
JleaY
#221333975Friday, July 14, 2017 9:35 PM GMT

b1 #code print("Lightning Flame Dragon Mode...") --I am totally not Natsu Dragneel

    of     1