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

Request - Quest Script

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (getPlayerStorageValue(cid, item.uid) == EMPTY_STORAGE) then
		doPlayerAddItem(cid, item.uid, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found ".. getItemNameById(item.uid) ..".")
		setPlayerStorageValue(cid, item.uid, 1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
	end
	return true
end
 
Help me again, what i have to fill in ?

function onUse(cid, item, fromPosition, itemEx, toPosition)
if (getPlayerStorageValue(cid, item.uid) == EMPTY_STORAGE) then
doPlayerAddItem(cid, item.uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found ".. getItemNameById(item.uid) ..".")
setPlayerStorageValue(cid, item.uid, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
return true
end

at item.uid ?

and what storage value
 
what means the storage ? idk what number i have to fill in there ... :(


and item.uid for crystal coin ? what i have to fill in ? "crystal coin" or the id "2160"
 
Dont' change anything in script, just add in actions.xml:
Code:
<item actionid="6666" event="script" value="somename.lua"/>

Then put chest on map:
Action ID: 6666
Unique ID: 2160 (Crystal Coin)
 
The script he made works.

@Northnorial
It's never too late to learn the basics of lua. :)
There are many beginner tutorials about lua here.

Hope you get it all working :peace:
 
One question ... I just have to use this script ?
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (getPlayerStorageValue(cid, item.uid) == EMPTY_STORAGE) then
		doPlayerAddItem(cid, item.uid, 1)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found ".. getItemNameById(item.uid) ..".")
		setPlayerStorageValue(cid, item.uid, 1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
	end
	return true
end

and then put chest on map:
Action ID: 6666
Unique ID: Item Id


Is that right ?
 
Back
Top