• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

simple script

GOD Fito

Member
Joined
Oct 3, 2008
Messages
97
Solutions
1
Reaction score
9
hi otland,

x quest get x item and that item only can use 3 times, and in the third time... item remove ^_^

also when you make two clicks in the article text displayed, this item will deleted in x times of use.

:p

something else

It's possible can put emblems(war system) in a function doPlayerPopupFYI? talkaction..
 
Last edited:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local storage = 15642
local amount = 3 -- amount how often a person can use this item

	if getPlayerStorageValue(cid, storage) == -1 then		
		setPlayerStorageValue(cid, storage, amount)
	end

	if getPlayerStorageValue(cid, storage) >= 2 then		
		setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) - 1)
		doPlayerSendTextMessage(cid, 22, "You can use this item "..getPlayerStorageValue(cid, storage).."x again before it gets deleted.")

	elseif getPlayerStorageValue(cid, storage) == 1 then	
		setPlayerStorageValue(cid, storage, -1)
		doRemoveItem(item.uid, 1)
	end
end
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
local storage = 15642
local amount = 3 -- amount how often a person can use this item
local pos = {x=1000, y=1000, z=7} -- edit here the position

 	if(getCreatureCondition(cid, CONDITION_INFIGHT)) then
    		return doPlayerSendCancel(cid,"You can\'t teleport when you are in a battle.")
 	end
 
	if getPlayerStorageValue(cid, storage) == -1 then		
		setPlayerStorageValue(cid, storage, amount)
	end
 
	if getPlayerStorageValue(cid, storage) >= 2 then		
		setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) - 1)
		doTeleportThing(cid, pos)
    		doSendMagicEffect(pos, CONST_ME_TELEPORT)
		doPlayerSendTextMessage(cid, 22, "You can use this item "..getPlayerStorageValue(cid, storage).."x again before it gets deleted.")
 
	elseif getPlayerStorageValue(cid, storage) == 1 then	
		setPlayerStorageValue(cid, storage, -1)
		doTeleportThing(cid, pos)
    		doSendMagicEffect(pos, CONST_ME_TELEPORT)
		doRemoveItem(item.uid, 1)
	end
end
 
Back
Top