I want to use this position, "local wall, ratp = {x = 2423, y = 947, z = 7}" in two different place.
local wall, ratp = {x = 2423, y = 947, z = 7} and x=x, y=x, z= x... is it possible?+
local id, time = 1547, 120
local wall, ratp = {x = 2423, y = 947, z = 7}, {x = 2425, y = 947, z = 7} <---- its just monster spawn
local function reset(pos)
doCreateItem(id, 1, wall)
doTransformItem(getTileItemById(pos, 1946).uid, 1945)
end
function onUse(cid,item,fromPosition,itemEx,toPosition)
if item.itemid == 1945 then
doRemoveItem(getTileItemById(wall, id).uid)
doCleanTile(ratp, false)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You removed the energy fence!\nEnergy fence will close in 2 min.")
doTargetCombatHealth(0, cid, COMBAT_ENERGYDAMAGE, -300, -500, CONST_ME_ENERGYHIT)
doCreateMonster('Xynex', ratp)
addEvent(reset, time * 1000, fromPosition)
doTransformItem(item.uid, 1946)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
return true
end
local wall, ratp = {x = 2423, y = 947, z = 7} and x=x, y=x, z= x... is it possible?+
local id, time = 1547, 120
local wall, ratp = {x = 2423, y = 947, z = 7}, {x = 2425, y = 947, z = 7} <---- its just monster spawn
local function reset(pos)
doCreateItem(id, 1, wall)
doTransformItem(getTileItemById(pos, 1946).uid, 1945)
end
function onUse(cid,item,fromPosition,itemEx,toPosition)
if item.itemid == 1945 then
doRemoveItem(getTileItemById(wall, id).uid)
doCleanTile(ratp, false)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You removed the energy fence!\nEnergy fence will close in 2 min.")
doTargetCombatHealth(0, cid, COMBAT_ENERGYDAMAGE, -300, -500, CONST_ME_ENERGYHIT)
doCreateMonster('Xynex', ratp)
addEvent(reset, time * 1000, fromPosition)
doTransformItem(item.uid, 1946)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
end
return true
end