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

Chest script :/ local fail xD

Reyn

On to the next One
Joined
May 15, 2010
Messages
259
Reaction score
1
Location
Germany ;3
Hei all :o
i'm not a master in lua but i tried a bit around

LUA:
local v = {3,4,7,8}

function onUse(cid, item, frompos, item2, topos)
	if item.uid == 12000 then
                if getPlayerVocation(cid) == v then
 		    queststatus = getPlayerStorageValue(cid,20040)
 		        if queststatus == -1 then
 				    doPlayerSendTextMessage(cid,22,"You have found a Combat Knife.")
 				    doPlayerAddItem(cid,2404,1)
       		 	            setPlayerStorageValue(cid,20040,1)
 				else
			            doPlayerSendTextMessage(cid,22,"It is empty.")
 				end
		else
			doPlayerSendTextMessage(cid,22,"You don't have the right vocation.")
		end
	else
	return 0
	end

return 1
end

but anyhow the local function doesnt work ... i aint gettin errors, it just tells me for every vocation that i dont have the right vocation... what i've done wrong? o_o
and lol yeah the tabbing is failed but anyhow its allright for me on notepad :o
 
Last edited:
PHP:
local v = {3,4,7,8}
function onUse(cid, item, frompos, item2, topos)
	if item.uid ~= 12000 then return true end
	
	if not(isInArray(v,getPlayerVocation(cid))) then
		return doPlayerSendTextMessage(cid,22,"You don't have the right vocation.")
	end
	
	local queststatus = getPlayerStorageValue(cid,20040)
	if queststatus ~= -1 then
		return doPlayerSendTextMessage(cid,22,"It is empty.")
	end
	
	doPlayerSendTextMessage(cid,22,"You have found a Combat Knife.")
	doPlayerAddItem(cid,2404,1)
	setPlayerStorageValue(cid,20040,1)
	return true
end
 
Back
Top