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

POI Help

Ninkobi

Owner /Founder of Syphera
Joined
Apr 5, 2008
Messages
206
Reaction score
1
Location
England
I am using TFS 0.3. and my poi all works except for the part where it checks you have stepped on all thrones. I tried to make it into a door with unique id 22222. Can anyone help, i just want a single door or something when u press it if youve done all thrones it will let u past.

Here is my script:
Code:
function onStepIn(cid, item, pos)
    if item.uid == 10001 then
        if getPlayerStorageValue(cid,1234561) == -1 then
            setPlayerStorageValue(cid,1234561,1)
            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 == 10002 then
        if getPlayerStorageValue(cid,1234562) == -1 then
            setPlayerStorageValue(cid,1234562,1)
            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 == 10003 then
        if getPlayerStorageValue(cid,1234563) == -1 then
            setPlayerStorageValue(cid,1234563,1)
            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 == 10004 then
        if getPlayerStorageValue(cid,1234564) == -1 then
            setPlayerStorageValue(cid,1234564,1)
            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 == 10005 then
        if getPlayerStorageValue(cid,1234565) == -1 then
            setPlayerStorageValue(cid,1234565,1)
            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 == 10007 then
        if getPlayerStorageValue(cid,1234567) == -1 then
            setPlayerStorageValue(cid,1234567,1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have touched Ashfalor´s throne and absorbed some of his spirit.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Ashfalor´s spirit.')
        end
    elseif item.uid == 22222 and item.itemid == 1213 and pos == {x=295, y=480, z=11} then
        if getPlayerStorageValue(cid,1234561) == -1 or getPlayerStorageValue(cid,1234562) == -1 or getPlayerStorageValue(cid,1234563) == -1 or getPlayerStorageValue(cid,1234564) == -1 or getPlayerStorageValue(cid,1234565) == -1 then
            doTransformItem(item.uid,item.itemid+1)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Sorry, but you did not absorb enough energy!')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You absorbed enough energy! You may pass.')
        end
    end
    return 1
end
 
Try this:

Code:
function onStepIn(cid, item, pos)
local name = ""
local message = "You have touched "..name.."'s throne and absorbed some of his spirit.")


    if item.uid == 10001 then
        if getPlayerStorageValue(cid,1234561) == -1 then
           	setPlayerStorageValue(cid,1234561,1)
		name = "Veminor"
            	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,message)
        else
            	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Veminor´s spirit.')
        end

    elseif item.uid == 10002 then
        if getPlayerStorageValue(cid,1234562) == -1 then
            	setPlayerStorageValue(cid,1234562,1)
		name = "Infernatil"
            	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,message)
        else
            	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Infernatil´s spirit.')
        end

    elseif item.uid == 10003 then
        if getPlayerStorageValue(cid,1234563) == -1 then
            	 setPlayerStorageValue(cid,1234563,1)
		name = "Tafariel"
            	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,message)
        else
           	 doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Tafariel´s spirit.')
        end

    elseif item.uid == 10004 then
        if getPlayerStorageValue(cid,1234564) == -1 then
          	setPlayerStorageValue(cid,1234564,1)
		name = "Apocalypse"
            	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,message)
        else
           	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Apocalypse´s spirit.')
        end

    elseif item.uid == 10005 then
        if getPlayerStorageValue(cid,1234565) == -1 then
           	setPlayerStorageValue(cid,1234565,1)
		name = "Pumin"
            	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,message)
        else
            	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Pumin´s spirit.')
        end

    elseif item.uid == 10007 then
        if getPlayerStorageValue(cid,1234567) == -1 then
            	setPlayerStorageValue(cid,1234567,1)
		name = "Ashfalor"
            	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,message)
        else
            	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have already absorbed some of Ashfalor´s spirit.')
        end

    elseif item.uid == 22222 and item.itemid == 1213 then
        if getPlayerStorageValue(cid,1234561) == 1 or getPlayerStorageValue(cid,1234562) == 1 or getPlayerStorageValue(cid,1234563) == 1 or getPlayerStorageValue(cid,1234564) == 1 or getPlayerStorageValue(cid,1234565) == 1 then
                doTransformItem(item.uid,item.itemid+1)
 		doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You absorbed enough energy! You may pass.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have not absorbed enough energy!')
        end
    end
    return 1
end
 
I don't think it will work cos its a door and a door already has a movement on it, thats why i think my original script didnt work (the door just opened)
 
Code:
        if getPlayerStorageValue(cid,1234561) == 1 or getPlayerStorageValue(cid,1234562) == 1 or getPlayerStorageValue(cid,1234563) == 1 or getPlayerStorageValue(cid,1234564) == 1 or getPlayerStorageValue(cid,1234565) == 1 then
                [b]doTransformItem(item.uid,item.itemid+1)[/b]
 		doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You absorbed enough energy! You may pass.')

Maybe it has just opened cos it is supposed to just open? lol...

Look in some other door scripts and you'll see how to make it so it will move the player or how to make him tp behind the door ;)
 
I made a new script for the last bit instead of a door a tile which tps you past if you have done all thrones. Here it is if it helps anyone else:

Code:
function onStepIn(cid, item, pos)
    if item.uid == 22222 and item.itemid == 471 then
        if getPlayerStorageValue(cid,1234561) == 1 or getPlayerStorageValue(cid,1234562) == 1 or getPlayerStorageValue(cid,1234563) == 1 or getPlayerStorageValue(cid,1234564) == 1 or getPlayerStorageValue(cid,1234565) == 1 or getPlayerStorageValue(cid,1234567) == 1 then
			local pos = {x=1313, y=1147, z=14}
			doTeleportThing(cid,pos)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You absorbed enough energy! You may pass.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Sorry, but you did not absorb enough energy!')
			local pos2 = {x=1313, y=1152, z=14}
			doTeleportThing(cid,pos2)
        end
    end
    return 1
end
 
Back
Top