• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

need help with anni script

grogan

New Member
Joined
Dec 6, 2007
Messages
133
Reaction score
0
Help with anni script

--------------------------------------------------------------------------------

Im haveing trouble with my anhilator script does anyone know the problem

in actions.xml i have

<action uniqueid="30015" script="quests/annihilator.lua"/>

and my script

code:
local playerPosition =
{
{x = 247, y = 659, z = 13, stackpos = STACKPOS_TOP_CREATURE},
{x = 247, y = 660, z = 13, stackpos = STACKPOS_TOP_CREATURE},
{x = 247, y = 661, z = 13, stackpos = STACKPOS_TOP_CREATURE},
{x = 247, y = 662, z = 13, stackpos = STACKPOS_TOP_CREATURE}
}

local newPosition =
{
{x = 189, y = 650, z = 13},
{x = 189, y = 651, z = 13},
{x = 189, y = 652, z = 13},
{x = 189, y = 653, z = 13}
}

-- Do not modify the declaration lines below.
local player = {0, 0, 0, 0}
local failed = FALSE

function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
for i = 1, 4 do
failed = TRUE
player = getThingfromPos(playerPosition)
if player.itemid > 0 then
if isPlayer(player.uid) == TRUE then
if getPlayerStorageValue(player.uid, 30015) == -1 then
if getPlayerLevel(player.uid) >= 100 then
failed = FALSE
end
end
end
end
if failed == TRUE then
doPlayerSendCancel(cid, "Sorry, not possible.")
return TRUE
end
end
for i = 1, 4 do
doSendMagicEffect(playerPosition, CONST_ME_POFF)
doTeleportThing(player.uid, newPosition, FALSE)
doSendMagicEffect(newPosition, CONST_ME_ENERGYAREA)
end
doTransformItem(item.uid, item.itemid + 1)
elseif item.itemid == 1946 then
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return TRUE
end





when i switch the switch it says sorry not possible.. anyone know why thanks do i need to make the switch actionid in the mapeditor 30015?
 
Back
Top