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

shovel.lua take a look :)

tompan

Member
Joined
Dec 13, 2008
Messages
646
Reaction score
23
Location
Sweden
is it possible to make if i have an action id on a tile, then it will create item?

Code:
function onUse(cid, item, frompos, item2, topos)
	pos = getPlayerPosition(cid)
	if item2.itemid == 0 then
		return 0
	end
 
	if item2.itemid == 468 then
		doTransformItem(item2.uid,469)
		doDecayItem(item2.uid)
	elseif item2.itemid == 481 then
		doTransformItem(item2.uid,482)
		doDecayItem(item2.uid)
	elseif item2.itemid == 483 then
		doTransformItem(item2.uid,484)
		doDecayItem(item2.uid)
	elseif item2.itemid == 231 then
		rand = math.random(1,30)
		

		if rand == 6 then
			doSummonCreature("Scarab", topos)
			doTeleportThing(cid,topos)
			doTeleportThing(cid,pos)
		elseif rand == 15 then
			doPlayerAddItem(cid,2159,1)
		else
			doSendMagicEffect(topos,2)
		end
	else
		return 0
	end
	
	return 1
end


then is it just to do like this.
Code:
    if item.aid == 55555 then
		doTransformItem(item2.uid,469)
		doDecayItem(item2.uid)
thanks.
 
Use this its a script of me real tibia shovel.
Code:
function onUse(cid, item, frompos, item2, topos)
 
aID = xxx -- set action id of the item her
ticks = 30 -- time before it will change back
topos = {x=topos.x, y=topos.y, z=topos.z} -- position of the item
local rand = math.random(1,100) -- is for chance to success or fail

 if item2.itemid == 28 then
  return FALSE
 end

 if item2.itemid == 468 then
  doTransformItem(item2.uid,469)
  doDecayItem(item2.uid)

 elseif item2.itemid == 481 then
  doTransformItem(item2.uid,482)
  doDecayItem(item2.uid)

  elseif item2.itemid == 231 and item2.actionid == aID then
  doTransformItem(item2.uid,482)
  doDecayItemTo(topos, item2.itemid, ticks)
  doSendMagicEffect(topos, CONST_ME_POFF)

 elseif item2.itemid == 483 then
  doTransformItem(item2.uid,484)
  doDecayItem(item2.uid)

 elseif item2.itemid == 231 then
  if rand > 85 and item2.actionid == 0 then
   doSummonCreature("Scarab", topos)

  elseif rand == 15 and item2.actionid == 0 then
   doPlayerAddItem(cid,2159,1)

  else
   doSendMagicEffect(topos,2)

  end
 else

  return FALSE
 end

 return TRUE
 end


king regards jeffry,
 
Back
Top