• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

What is the correct way?

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
What is the correct way?
Thus:
Code:
if item.itemid == 1234 then
 -- script
  elseif item.itemid == 1234 then
  -- script
 return TRUE
end

Or this:
Code:
if item.itemid == 1234 then
 -- script
  return TRUE
   end
   if item.itemid == 1234 then
  -- script
 return TRUE
end

Sorry, my English is not very good.
 
What is the correct way?
Thus:
Code:
if item.itemid == 1234 then
 -- script
  elseif item.itemid == 1234 then
  -- script
 return TRUE
end

Or this:
Code:
if item.itemid == 1234 then
 -- script
  return TRUE
   end
   if item.itemid == 1234 then
  -- script
 return TRUE
end

Sorry, my English is not very good.

The First is the correct way, the second is wrong.

I think so...
 
The first one would be the correct one.
Also, start organizing your scripts like this:
Lua:
	if item.itemid == 1234 then
		script
	elseif item.itemid == 1234 then
		script
		return TRUE
	end
That's how it would be tabbed correctly. You organize them in a piramid-ish way, and that's not correct.
 
Back
Top