Code:
function onStepIn(cid, item, position, fromPosition)
getbody1 = getThingfromPos({x = position.x+1, y = position.y, z = position.z, stackpos = 1})
getbody2 = getThingfromPos({x = position.x-1, y = position.y, z = position.z, stackpos = 1})
if (getbody1.itemid == 3065 or getbody1.itemid == 3058 and getbody2.itemid == 3065 or getbody1.itemid == 3058) then
if (doRemoveItem(getbody1.uid, 1) == LUA_NO_ERROR and doRemoveItem(getbody2.uid, 1) == LUA_NO_ERROR) then
doTeleportThing(cid, {x = 331, y = 495, z = 10}, FALSE)
doCreatureAddHealth(cid, -getCreatureMaxHealth(cid)*0.33)
doSendMagicEffect(position, 2)
end
else
doPlayerSendCancel(cid,"Nothing has been offered to pass the barrier.")
end
return true
end