• 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 Storage problem ( Need help fast)

arbixa

New Member
Joined
Mar 22, 2010
Messages
7
Reaction score
0
Location
Sweden
When a player use a item on another item then he will get a storage for 10 sec.
How do I get it to work?
 
kinda simple actually..
first you make a function for example this:

function remStor(cid)
setstoragefunction(cid, storage)-- removes
end

and then on onUseItem

if(item.itemid == ITEMID and itemEx.itemid == UseONITEMID) then

setstoragefunction(cid, storage, key[1])
addEvent(remStor, 10000, cid)

end
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {
	first_item = 0, --change it to itemid
	second_item = 0, --change it to second itemid
	storage = 0, --change it to storage number
	s_time 0= --change it to how long 
	}

if item.itemid == cfg.first_item and itemEx.itemid == cfg.second_item then
	if exhaustion.check(cid, cfg.storage) == false then
		exhaustion.set(cid, cfg.storage, cfg.s_time)
	end
end
return true
end
 
Back
Top