K4stic Posted January 8, 2013 Posted January 8, 2013 says error: attempt to perform arithmetic on a nil value setElementData ( source, "cans", tonumber(getElementData(source, "cans") or 0) + cans, false ) Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted January 8, 2013 Posted January 8, 2013 local currentCans = tonumber ( getElementData ( source, "cans" ) ) or 0 setElementData ( source, "cans", currentCans + cans, false ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
K4stic Posted January 8, 2013 Author Posted January 8, 2013 thx it's work i will say you if i find bug because i have fix with help of community and some my self that 5-6 time's and still bugget after 1 day Giving a Fuck? Nope, That isn't in My Skill Set
Castillo Posted January 8, 2013 Posted January 8, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
50p Posted January 8, 2013 Posted January 8, 2013 says error: attempt to perform arithmetic on a nil value setElementData ( source, "cans", tonumber(getElementData(source, "cans") or 0) + cans, false ) If you still want that in 1 line which I would unless you need to use current cans number more than once, you need to pay close attention to brackets: setElementData ( source, "cans", ( tonumber( getElementData(source, "cans" ) ) or 0 ) + cans, false ) - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now