@Mate,
[lua] prop:setFilenameTo(“A.txt”) – First set the filename to A.txt
prop:GetFromFile() – Load the data from that file
– Always run that after changing the filename (just in case)
level = tonumber(prop:getProperty(“level”,1))
– The default is 1 the first time
score = tonumber(prop:getProperty(“score”,100))
– The default is 100 the first time
prop:SaveToFile() – Save the data to the file
prop:setFilenameTo(“B.txt”) – First set the filename to A.txt
prop:GetFromFile() – Load the data from that file
– Always run that after changing the filename (just in case)
prop:getProperty(“power”,100) – The default is 1 the first time
playerscore = tonumber(prop:getProperty(“player_score”,1000))
– The default is 100 the first time
prop:SaveToFile() – Save the data to the file[/lua]
I do not want to ask why you have two different files for the scores, etc when you can manage them with one.
Now somewhere in your code you update these values and work with them, so to save them back, you would use
[lua] prop:setFilenameTo(“A.txt”) – First set the filename to A.txt
prop:GetFromFile() – Load the data from that file
prop:setProperty(“level”,10)
prop:SaveToFile() – Save the data to the file
prop:setFilenameTo(“B.txt”) – First set the filename to A.txt
prop:GetFromFile() – Load the data from that file
prop:setProperty(“power”,200)
prop:SaveToFile() – Save the data to the file[/lua]
hope that resolves your issue. and if you say that it does not work, you will have to provide a bit more to help you out on this than it doesn’t work.
cheers,
?
[import]uid: 3826 topic_id: 12884 reply_id: 48566[/import]