Teddy
SweStream.se
Hello guys/girls
i need some help whit a new script over here ..
i need a script when
you set a item on ITEM1 zone and ITEM2 zone and pull the switch you get a new item and the other item disappear ..
IMG :
ofc i give rep
---
EDIT :
anyone have it ? i cant get it work ..
No errors in console ..
actions.xml
poiquest.lua
i need some help whit a new script over here ..
i need a script when
you set a item on ITEM1 zone and ITEM2 zone and pull the switch you get a new item and the other item disappear ..
IMG :
ofc i give rep
---
EDIT :
anyone have it ? i cant get it work ..
No errors in console ..
actions.xml
Code:
<action uniqueid="9494" script="poiquest.lua" />
Code:
local items = { remove1 = 2217, remove2 = 2137, newItem = 2217 }
local positions =
{
[1] = {place = {x=212, y=669, z=7}}, -- Second Item Position
[2] = {place = {x=214, y=669, z=7}} -- Second Item Position
}
local place1 = getThingfromPos(positions[1].place)
local place2 = getThingfromPos(positions[2].place)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (item.itemid == 1945) and (item.uid == 9494) then
if (place1 == items.remove1) and (place1 == items.remove2) then
doRemoveItem(place1.uid, 1)
doRemoveItem(place2.uid, 1)
doPlayerAddItem(cid, items.newItem, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New Item Added!")
else
doPlayerSendCancel(cid, "You must have the items on the correct spot.")
end
elseif (item.itemid == 1946) then
doSendMagicEffect(fromPosition, CONST_ME_POFF)
doTransformItem(item.uid, item.itemid-1)
end
return TRUE
end
Last edited: