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

Lua POI door [REP++]

This is the script im using for the door before the rewards room: (im using a dorr with ID 1223 with unique ID 10281)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local charpos = getPlayerPosition(cid)
if item.uid == 10281 and charpos.x == 24 and (charpos.y == 155 or charpos.y == 154) and charpos.z == 6 then
if getPlayerStorageValue(cid,10274) == -1 or getPlayerStorageValue(cid,10275) == -1 or getPlayerStorageValue(cid,10276) == -1 or getPlayerStorageValue(cid,10277) == -1 or getPlayerStorageValue(cid,10278) == -1 or getPlayerStorageValue(cid,10279) == -1 or getPlayerStorageValue(cid,10280) == -1 then
doPlayerSendTextMessage(cid,25,'Você não absorveu energia suficiente!')
else
local newPos = {x=22, y=155, z=6}
doTeleportThing(cid, newPos)
doSendMagicEffect(newPos, 10)
end

elseif item.uid == 10281 and charpos.x == 22 and (charpos.y == 155 or charpos.y == 156) and charpos.z == 6 then
local newPos = {x=24, y=155, z=6}
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid, newPos)

doSendMagicEffect({x=24,y=155,z=6}, 10)
end
return 1
end

The first charpos.x and y and z is the position BEFORE the Door. The script will check if any throne is missing. If everything is okay, then the player will be teleported to the other side of the door (local newPos = {x=22, y=155, z=6}).



2. And for the effect, just past
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_BIGCLOUDS)
after
doPlayerSendTextMessage(cid, TALKTYPE_BROADCAST, "You have touched " .. CONFIG[item.actionid].seal .. "\'s throne and absorbed some of his sprit.")

Post if you need any help.
 
Any errors?

Btw, that script isn´t an ACTION script, it is a MOVEMENT script! May you are trying to use that as an ACTION??
 
I moved it into movements, put it into movements.xml and its still not working :/ i changed the uniqe ids to what they should be but again its not working, is there anything else i must change? If not i must have something else thats gone wrong somewhere but NO errors appear in the console with the door script either.

EDIT: When i remove it from actions.xml then it doesn't say "You have no absorbed enough energy" anymore either
 
Sorry man, i made a mistake. Check it out:
Actions.xml -> last door before the reward room
function onUse(cid, item, fromPosition, itemEx, toPosition)
local charpos = getPlayerPosition(cid)
if item.uid == 10281 and charpos.x == 24 and (charpos.y == 155 or charpos.y == 154) and charpos.z == 6 then
if getPlayerStorageValue(cid,10274) == -1 or getPlayerStorageValue(cid,10275) == -1 or getPlayerStorageValue(cid,10276) == -1 or getPlayerStorageValue(cid,10277) == -1 or getPlayerStorageValue(cid,10278) == -1 or getPlayerStorageValue(cid,10279) == -1 or getPlayerStorageValue(cid,10280) == -1 then
doPlayerSendTextMessage(cid,25,'Você não absorveu energia suficiente!')
else
local newPos = {x=22, y=155, z=6}
doTeleportThing(cid, newPos)
doSendMagicEffect(newPos, 10)
end

elseif item.uid == 10281 and charpos.x == 22 and (charpos.y == 155 or charpos.y == 156) and charpos.z == 6 then
local newPos = {x=24, y=155, z=6}
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid, newPos)

doSendMagicEffect({x=24,y=155,z=6}, 10)
end
return 1
end

then you need to edit the actions.xml
<action uniqueid="10281" script="doors/poi_last.lua" />

Movements.xml -> the thrones script (already with animation effect)
function onStepIn(cid, item, pos)

if item.uid == 10274 then
if getPlayerStorageValue(cid,10274) == -1 then
setPlayerStorageValue(cid,10274,1)
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_BIGCLOUDS)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Verminor´s throne and absorbed some of his spirit.')
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Veminor´s spirit.')
end
elseif item.uid == 10275 then
if getPlayerStorageValue(cid,10275) == -1 then
setPlayerStorageValue(cid,10275,1)
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_BIGCLOUDS)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Infernatil´s throne and absorbed some of his spirit.')
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Infernatil´s spirit.')
end
elseif item.uid == 10276 then
if getPlayerStorageValue(cid,10276) == -1 then
setPlayerStorageValue(cid,10276,1)
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_BIGCLOUDS)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Tafariel´s throne and absorbed some of his spirit.')
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Tafariel´s spirit.')
end
elseif item.uid == 10277 then
if getPlayerStorageValue(cid,10277) == -1 then
setPlayerStorageValue(cid,10277,1)
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_BIGCLOUDS)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Apocalypse´s throne and absorbed some of his spirit.')
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Apocalypse´s spirit.')
end
elseif item.uid == 10278 then
if getPlayerStorageValue(cid,10278) == -1 then
setPlayerStorageValue(cid,10278,1)
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_BIGCLOUDS)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Pumin´s throne and absorbed some of his spirit.')
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Pumin´s spirit.')
end
elseif item.uid == 10279 then
if getPlayerStorageValue(cid,10279) == -1 then
setPlayerStorageValue(cid,10279,1)
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_BIGCLOUDS)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Bazir´s throne and absorbed some of his spirit.')
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Bazir´s spirit.')
end
elseif item.uid == 10280 then
if getPlayerStorageValue(cid,10280) == -1 then
setPlayerStorageValue(cid,10280,1)
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_BIGCLOUDS)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Ashfalor´s throne and absorbed some of his spirit.')

else
doTeleportThing(cid,{x=540, y=1526, z=14})
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MORTAREA)
doCreatureSay(cid, "Begone!", TALKTYPE_ORANGE_1)
end

end
return 1
end

again, you need to edit you movements.xml
<movevent type="StepIn" itemid="5915" event="script" value="PitsOfInferno/AllThrones.lua" />
<movevent type="StepIn" itemid="5916" event="script" value="PitsOfInferno/AllThrones.lua" />

Redo the script to actions.xml and do all thrones again. That msg
EDIT: When i remove it from actions.xml then it doesn't say "You have no absorbed enough energy" anymore either
means you did not finished all thrones (or you acctual thrones script is not working)

BTW THE STORAGE VALUES of the actions.xml ARE DIFFERENT FROM YOUR THRONES SCRIPT - CHECK IT OUT!

local CONFIG = {
[56486]={storage = 19551, seal = "Verminor"},
[56487]={storage = 19552, seal = "Infernatil"},
[56488]={storage = 19553, seal = "Tafariel"},
[56489]={storage = 19554, seal = "Apocalypse"},
[56410]={storage = 19555, seal = "Pumin"},
[56411]={storage = 19556, seal = "Bazir"},
[56412]={storage = 19557, seal = "Ashfalor"}
}

function onStepIn(cid, item, position, fromPosition)
if getPlayerStorageValue(cid, CONFIG[item.actionid].storage) == -1 then
doPlayerSendTextMessage(cid, TALKTYPE_BROADCAST, "You have touched " .. CONFIG[item.actionid].seal .. "\'s throne and absorbed some of his sprit.")
setPlayerStorageValue(cid, CONFIG[item.actionid].storage, 1)
else
doPlayerSendTextMessage(cid, TALKTYPE_BROADCAST, "You already have touched " .. CONFIG[item.actionid].seal .. "\'s throne and absorbed some of his sprit.")
end
return TRUE
end

TRY USING MINE (if you are not using that storage values as well) or try EDITING the last door script (the one in actions.xml) and change the storage values here:
if getPlayerStorageValue(cid,10274) == -1 or getPlayerStorageValue(cid,10275) == -1 or getPlayerStorageValue(cid,10276) == -1 or getPlayerStorageValue(cid,10277) == -1 or getPlayerStorageValue(cid,10278) == -1 or getPlayerStorageValue(cid,10279) == -1 or getPlayerStorageValue(cid,10280) == -1 then
10274,10275,10276,10277,10278,10279,10280 (use 19551,19552 and so on...)
 
OK, i tried your ones edited everything, didn't work BUT i realised that my thrones had an action ID when they shouldn't. I removed them all and now restarting server so lets see how it goes ;)
 
Its taken me hours of trying to edit things (i know next to nothing about LUA and only learnt a few things on how to edit bits yesturday) and searching and FINALLY, it works. Thanks alot for your help i really appreciate it <3333
 
Back
Top