• 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!

Solved Poi throne script not working

Finduz

New Member
Joined
Nov 13, 2014
Messages
40
Reaction score
0
I have this poi script for my ot. It loads without any problems. But nothing happen when you walk over a throne.
Can someone please have a look?

Thanks!

Code:
local t = {
[10274] = {'Verminor', CONST_ME_POISONAREA, 3},
[10275] = {'Infernatil', CONST_ME_HITBYFIRE, 4},
[10276] = {'Tafariel', CONST_ME_POFF, 4},
[10277] = {'Apocalypse', CONST_ME_EXPLOSIONAREA, 3},
[10278] = {'Pumin', CONST_ME_YELLOW_RINGS, 4},
[10279] = {'Ashfalor', CONST_ME_MORTAREA, 5}
}

function onStepIn(cid, item, pos, fromPos)
if isPlayer(cid) == TRUE then
local f = t[item.uid]
if getPlayerStorageValue(cid, item.uid) == -1 then
setPlayerStorageValue(cid, item.uid, 1)
doSendMagicEffect(pos, f[2])
doCreatureSay(cid, 'You have touched '..f[1]..'\'s throne and absorbed some of his spirit.', TALKTYPE_ORANGE_1)
else
if item.itemid == 5915 then
pos.y = pos.y + f[3]
elseif item.itemid == 5916 then
pos.x = pos.x + f[3]
end
doTeleportThing(cid, pos)
doSendMagicEffect(pos, CONST_ME_MORTAREA)
doCreatureSay(cid, 'Begone!', TALKTYPE_ORANGE_1)
end
end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1229 then
for i = 10274, 10279 do
if getPlayerStorageValue(cid, i) == -1 then
return TRUE, doPlayerSendCancel(cid, 'You didn\'t absorb enough energy.')
end
end
doTransformItem(item.uid, 1230)
doTeleportThing(cid, toPosition)
end
return TRUE
end
 
Last edited by a moderator:
Give more information, how did you added the script in movements.xml and how is it added in the map? Are the uids correct and the itemid?
 
Give more information, how did you added the script in movements.xml and how is it added in the map? Are the uids correct and the itemid?
<movevent event="StepIn" itemid="5915" script="poi.lua" />
<movevent event="StepIn" itemid="5916" script="poi.lua" />
All the uids and itemid's are correct.
All the thrones have their uids set in map editor as in the first script I linked.
 
Code:
<movevent type="StepIn" itemid="5915" event="script" value="poi.lua"/>
<movevent type="StepIn" itemid="5916" event="script" value="poi.lua"/>
 
Back
Top