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

My custom quest!

KnightmareZ

New Member
Joined
Feb 3, 2008
Messages
607
Reaction score
4
Location
Sweden/Ljungby
hello there, I want a script like this:
-When 8 ppl on the SQM's and 8 ring of the skies on the 1 SQM above where the player should stand they can pull lever and ring of the skies disapears and they get TPed..

This is the code someone made for me so far but doesnt work..

Code:
local playerPos = 
    {
        {x = 33273, y = 31055, z = 8},
        {x = 33274, y = 31055, z = 8},
        {x = 33275, y = 31055, z = 8},
        {x = 33276, y = 31055, z = 8},
        {x = 33277, y = 31055, z = 8},
        {x = 33278, y = 31055, z = 8},
        {x = 33279, y = 31055, z = 8},
        {x = 33280, y = 31055, z = 8}
    }
    
local newPos =
    {
        {x = 33311, y = 31062, z = 9},
        {x = 33313, y = 31062, z = 9},
        {x = 33315, y = 31062, z = 9},
        {x = 33312, y = 31064, z = 9},
        {x = 33314, y = 31064, z = 9},
        {x = 33311, y = 31066, z = 9},
        {x = 33313, y = 31066, z = 9},
        {x = 33315, y = 31066, z = 9}
    }

local itemID = 2123 --rots

local leverUID = 7575

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if (leverUID == item.uid) then
        for _, pos in ipairs(playerPos) do
            pos.stackpos = 253
            if not isPlayer(getThingFromPos(pos).uid) then
                doPlayerSendCancel(cid, "Sorry, not Possible.")
                return true
            end
            pos.stackpos = 2 --Change if necesary
            pos.y = pos.y - 1 --1 sqm above player pos
            if getThingFromPos(pos).itemid ~= itemID then
                doPlayerSendCancel(cid, "Sorry, not Possible.")
                return true
            end
        end
        for k, pos in ipairs(playerPos) do
            pos.stackpos = 253
            doTeleportThing(getThingFromPos(pos).uid, newPos[k], false)
            pos.stackpos = 2 --Change if necesary
            pos.y = pos.y - 1 --1 sqm above player pos
            doRemoveItem(getThingFromPos(pos).uid)
        end
        doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
    end
    return true
end

action.lua:
Code:
		<action uniqueid="7575" event="script" value="quests/Underworldquest.lua"/>

I got the lever with UID: 7575

Here is a picture how it should look like:
1hqsjk.jpg


Thank you! rep++
 
PROTIP: Use
1671oqa.gif
instead of
10r4wmp.png


PROTIP N°2: Use this script:
Code:
local playerPos =  {
	{x = 33273, y = 31055, z = 8},
	{x = 33274, y = 31055, z = 8},
	{x = 33275, y = 31055, z = 8},
	{x = 33276, y = 31055, z = 8},
	{x = 33277, y = 31055, z = 8},
	{x = 33278, y = 31055, z = 8},
	{x = 33279, y = 31055, z = 8},
	{x = 33280, y = 31055, z = 8}
}
	
local newPos = {
	{x = 33311, y = 31062, z = 9},
	{x = 33313, y = 31062, z = 9},
	{x = 33315, y = 31062, z = 9},
	{x = 33312, y = 31064, z = 9},
	{x = 33314, y = 31064, z = 9},
	{x = 33311, y = 31066, z = 9},
	{x = 33313, y = 31066, z = 9},
	{x = 33315, y = 31066, z = 9}
}

local itemID = 2123 --rots

function onUse(cid, item, fromPosition, itemEx, toPosition)
	for _, pos in ipairs(playerPos) do
		if not isPlayer(getTopCreature(pos).uid) or getTileItemById({x=pos.x, y=pos.y-1, z=pos.z}, itemID).uid < 1 then
			return doPlayerSendCancel(cid, "Sorry, not possible.")
		end
	end
	for k, pos in ipairs(playerPos) do
		doTeleportThing(getTopCreature(pos).uid, newPos[k])
		doRemoveItem(getTileItemById({x=pos.x, y=pos.y-1, z=pos.z}, itemID).uid)
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
 
Last edited:
Back
Top