lotus006 wrote:
I'm not very good in lua not now :S , but with the "
Currency:get(1)" the 1 is just a number on save and get you need to put a variable to insert the value you want.
like
Code: Select all
local banana = 1
currency:save("banana");
Currency:get("banana")
Sorry if i'm wrong
What you're doing is absolute bollocks. Watch the case-sensitivity

Also, You're trying to set the currency to a string, which isn't possible.
I'll give you a quick run-through of the Data class and how it differs from the raocoin class, from my understanding:
The data class lets you save values to different strings inside a file, which can be carried across levels. If you want to set a value, you do this:
data:set("value", 1)
sata:save()
This sets the value of "value" to 1. If you fancy, you can go more complicated and do stuff like
data:set("value", data:get("value") + 1)
to have it count up every time the event is executed.
To get a variable from the data class, you, as seen above, type
data:get("value")
You can save this to a variable by typing
local variable = data:get("value")
and vice-versa, you don't have to use numbers when setting your custom data class element:
data:set("other thing", variable)
data:save()
The Currency class for raocoin seems to get rid of the string present in the data class, which means all you can set now is the value of the internal currency. With Currency:get() you get the value of the currency, and with Currency:set(number) you can set it. Currency:save() works the same way as in the data class.
Someone with more knowledge, correct me if I'm wrong.