• 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!

Lua question.. Help plx ~quick~

Status
Not open for further replies.

JoSePh15_

Well-Known Member
Joined
Jan 28, 2010
Messages
1,766
Reaction score
59
LUA:
if getPlayerItemCount(cid, 7436) == 2 and getPlayerItemCount(cid, 8892) == 1 and getPlayerItemCount(cid, 7886) == 1 then
It should be like that? or what? cuz it is not working like that!
Help i rep++ xD
 
This works fine...

Code:
local items = {
	[xxx] = 1,
	[xxx] = 1,
	[xxx] = 2
}
for id, c in pairs(items) do
	if getPlayerItemCount(cid, id) >= c then
		-- do something amazing
	else
		-- do something else amazing
	end
	
	return true
end
 
LUA:
local items = {
	{7436,2}, {8892,1}, {7886,1}
}

for _, v in ipairs(items) do
	if getPlayerItemCount(cid, v[1]) < v[2] then
		return false -- fail
	end
end

-- do something amazing
 
Status
Not open for further replies.
Back
Top