local m = m - 1000
My variable is not taking away the number. I know this is a simple fix but i tried everything and it doesn't work. Thank you.
local m = m - 1000
My variable is not taking away the number. I know this is a simple fix but i tried everything and it doesn't work. Thank you.
well you cant do local m = m - 1000 because the variable m is just being declared..
at run time, the statement actually looks like this m = nil - 1000.. so if variable m in m - 1000 was not declared before using it, it should through an error that says attempt to do arithmetic on global m(a nil value or something like that. or sometimes the code will just halt when it reaches that statement.
i recommend doing it like this:
local x = 500 --whatever number you want
local m = x - 1000
the above should work fine b/c x is declared before used, so the statement won't look like this on run time m = nil - 1000
This discussion is preserved as it was. New answers, comments, and votes are closed.
6 comments
it was already decal
*declared
It just been declared, so m don't has any value.
in that case then do
m = m - 1000and notlocal m = m - 1000Thanks. It worked.
np