• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Ancient Helmet

Keru

Entrepreneur
Joined
Jul 24, 2008
Messages
1,777
Solutions
2
Reaction score
167
Location
USA
goto movements create a new script an put the name of ancienthelmet and put this inside
PHP:
function onStepIn(cid, item, pos)

piezaspos = {x=1198, y=1079, z=8, stackpos=7}
piezaspos2 = {x=1198, y=1079, z=8, stackpos=6}
piezaspos3 = {x=1198, y=1079, z=8, stackpos=5}
piezaspos4 = {x=1198, y=1079, z=8, stackpos=4}
piezaspos5 = {x=1198, y=1079, z=8, stackpos=3}
piezaspos6 = {x=1198, y=1079, z=8, stackpos=2}
piezaspos7 = {x=1198, y=1079, z=8, stackpos=1}
getpieza1 = getThingfromPos(piezaspos)
getpieza2 = getThingfromPos(piezaspos2)
getpieza3 = getThingfromPos(piezaspos3)
getpieza4 = getThingfromPos(piezaspos4)
getpieza5 = getThingfromPos(piezaspos5)
getpieza6 = getThingfromPos(piezaspos6)
getpieza7 = getThingfromPos(piezaspos7)


if isPlayer(cid) == TRUE then
  if item.uid == 23420 and item.itemid == 416 then
    if getpieza1.itemid == 2335 then
         doRemoveItem(getpieza1.uid,1)
	     if getpieza2.itemid == 2336 then
	     doRemoveItem(getpieza2.uid,1)
	  	 if getpieza3.itemid == 2337 then
         doRemoveItem(getpieza3.uid,1)
		 if getpieza4.itemid == 2338 then
		 doRemoveItem(getpieza4.uid,1)
         if getpieza5.itemid == 2339 then
		 doRemoveItem(getpieza5.uid,1)
		 if getpieza6.itemid == 2340 then
		 doRemoveItem(getpieza6.uid,1)
        if getpieza7.itemid == 2341 then
		 doRemoveItem(getpieza7.uid,1)
	  
      doCreateItem(2342,1,piezaspos)
	  doSendMagicEffect(pos, CONST_ME_FIREAREA)
    end 
    else 
      doPlayerSendCancel(cid, "The items are not on the correct spots.") 
      return TRUE 
    end
  end
end
end
end
end
end
end
end
then goto movements.xml and put in
PHP:
<movevent type="StepIn" uniqueid="23420" event="script" value="ancienthelmet.lua"/>

bug if u donot put the items in order it disapear that are in the right order and the others stay in ther with out a cahnges
 
Last edited:
I'm using 0.3.5, don't have access to my pc atm.. but doremoveitem requires unique id...
Check the lua script.
You'll need all UIDs of the items, I guess.
Sorry If i'm wrong, i'm on psp and don't have the lua scripts.
 
Code:
local pos = {x=1198, y=1079, z=8}
function onStepIn(cid, item, position)
	if isPlayer(cid) == TRUE then
		local it = {}
		for i = 2335, 2341 do
			local _i = getTileItemById(pos, i).uid
			if _i > 0 then it[i] = _i else return end
		end
		for _, v in ipairs(it) do
			doRemoveItem(v)
		end
		doCreateItem(2342, 1, pos)
		doSendMagicEffect(pos, CONST_ME_FIREAREA)
	end
end
 
thank u a lot :), but im requestin to fix mi scrip, but until that im going to use urs :)
 
Lua:
doRemoveItem(getpieza1.uid,1) -- First Item
doRemoveItem(2336,1,piezaspos) -- The other items

See the difference? ^^
 
o0 oo @Sypher
i see it xD hahaha just let me go home about 10,11 i can test :p thx
@Cykotitan
u fix it or put another one xD haha :p but, still thx for the script :p
 
Code:
local pos = {x=1198, y=1079, z=8}
function onStepIn(cid, item, position)
	if isPlayer(cid) == TRUE then
		local it = {}
		for i = 2335, 2341 do
			local _i = getTileItemById(pos, i).uid
			if _i > 0 then it[i] = _i else return end
		end
		for _, v in ipairs(it) do
			doRemoveItem(v)
		end
		doCreateItem(2342, 1, pos)
		doSendMagicEffect(pos, CONST_ME_FIREAREA)
	end
end

xD dosent work, well it does create the item but dosent remove the items
 
ok, a less advanced version:
Code:
local pos = {x=1198, y=1079, z=8}
function onStepIn(cid, item, position)
	if isPlayer(cid) == TRUE then
		for i = 2335, 2341 do
			if getTileItemById(pos, i).uid < 1 then return end
		end
		for i = 2335, 2341 do
			doRemoveItem(getTileItemById(pos, i).uid)
		end
		doCreateItem(2342, 1, pos)
		doSendMagicEffect(pos, CONST_ME_FIREAREA)
	end
end
 
actualy i use urs :p but i want to improve my skill on scripting xD i know its scuks thats why im practising :)
 
Back
Top