CheatTester Posted April 10, 2020 Posted April 10, 2020 i have saved list like this list: 1. name : dataone, value : 99 2. name : datatwo, value : 88 3. name : datatri, value : 77 i want to change the value with label name "dataone" and usually iam using this to change the value r = gg.getListItems() r[1].value = 9999 gg.setValues(r) and then "dataone" value change. =============================== but often "dataone" is randomly change place like this after i restart the game, list: 1. name : datatwo, value : 88 2. name : datatri, value : 77 3. name : dataone, value : 99 <<<<< dataone saved to the third list my question, can i do something like: :: search saved list with label name "dataone" then change the value. thank you
Administrators Enyby Posted April 10, 2020 Administrators Posted April 10, 2020 Yes. Get all values from saved list tot table. Iterate over table via loop. Check name of item on body loop. If name is desired - change value.
Gennessey Posted April 10, 2020 Posted April 10, 2020 32bit games when I launch it from parallel space the game just kicks me out and I let's me go into it but just kicks me from the game and I dont know why
CheatTester Posted April 11, 2020 Author Posted April 11, 2020 Sorry another question, how about change multiple value at once like r = gg.getListItems() r[1].value = 9999 r[2].value = 8888 r[3].value = 7777 gg.setValues(r) But using the name like Dataone = 9999 Datatwo = 8888 Datatri = 7777 setValue ====== Can i get some examples? Thank you
Administrators Enyby Posted April 11, 2020 Administrators Posted April 11, 2020 Same as above^ get all to table, iterate over table, check name, if name equals desired - change value. And set all values after loop.
CheatTester Posted April 11, 2020 Author Posted April 11, 2020 this work but, iam note sure, can we make it more simple? t = gg.getListItems() for i, v in ipairs(t) do if v.name == 'Dataone' then v.value = 999 elseif v.name == 'Datatri' then v.value = 998 end end gg.setValues(t)
Administrators Enyby Posted April 11, 2020 Administrators Posted April 11, 2020 You can use table which map your names to desired values. If name of item exists in table then you can edit value. Like this: local val = values[v.name] if val != nil then v.value = val end
Question
CheatTester
i have saved list like this
list:
1. name : dataone, value : 99
2. name : datatwo, value : 88
3. name : datatri, value : 77
i want to change the value with label name "dataone"
and usually iam using this to change the value
r = gg.getListItems()
r[1].value = 9999
gg.setValues(r)
and then "dataone" value change.
===============================
but often "dataone" is randomly change place like this after i restart the game,
list:
1. name : datatwo, value : 88
2. name : datatri, value : 77
3. name : dataone, value : 99 <<<<< dataone saved to the third list
my question, can i do something like:
:: search saved list with label name "dataone" then change the value.
thank you
6 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.