Originally Posted by
Mpzor
crystaI: I understand a bit more now after you explained it, so thank you

So if I understand correctly "~= 0" would be the same as "~= nil"? If not, what does "nil" mean?
edit: And why is "end" sometimes used a couple of times in a row at the end? Shouldnt it be enough with just one "end" ?
~=0 is not equal to zero and zero in lua is a value
nil to lua is nothing; as in it has no value and doesn't exist
as for the extra end,
for every if then statement, do while, or for loop you open it must be closed. now you can put if then statements and such inside other if then's. its called 'nesting' or 'nested if statement'.
example
Code:
--nested if then example 1
if UnitExists("player") then
if UnitisDead("player") then
return true
end
end
or it can look like this
--nested if then example 2
if UnitExists("player") then
if UnitisDead("player") then return true end
end
and some people do this
--nested example 3
if UnitExists("player") then
if UnitisDead("player") then
return true
end
end
they all do the same thing, but I like to indent(tab or five spaces of the spacebar) like example 1 and 2 so i know that each statement is closed. there are times when i've nested more than just 1 if then and if i do that i just add another tab or five spaces to keep it all lined up and looking nice.