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

Requesting a script..

furstwin

New Member
Joined
Aug 9, 2007
Messages
486
Reaction score
1
Location
Sweden
As the title says im requesting a script :P
I would be really glad if someone would fix it for me so here we go :P

Theres 2 statues in a room and when I use the statues they light on(+1 ID) and when I lighted both statues 3 stones will remove and I'll be able to walk into a portal, aswell, also when I Unlight one statue the stones will be back on their positions, even is 1 statue is still lighted. Hope you understand :)

Sincerely,
Furstwin.
 
The positions must be wrong! Or the itemids :o

What itemid were the statue when you pressed it? xD

You messed up the stone positions but it still fails changing the statue ids >.<

It should be:
Code:
doTransformItem(item.uid, item.itemid +1)
right?
The statue ids r right tho(3697)
 
Bah, try this then:
PHP:
local statue1Pos = {x=409, y=108, z=8, stackpos=1} 
local statue2Pos = {x=400, y=108, z=8, stackpos=1} 

local stone1Pos = {x=403, y=121, z=8, stackpos=1} 
local stone2Pos = {x=404, y=122, z=8, stackpos=1} 
local stone3Pos = {x=405, y=123, z=8, stackpos=1} 

function onUse(cid, item, frompos, topos) 
    local getStatue1 = getThingfromPos(statue1Pos) 
    local getStatue2 = getThingfromPos(statue2Pos) 

    local getStone1 = getThingfromPos(stone1Pos) 
    local getStone2 = getThingfromPos(stone1Pos) 
    local getStone3 = getThingfromPos(stone1Pos) 

    if item.uid == 3697 then 
        local getStatue = getStatue1 
    elseif item.uid == 3698 then 
        local getStatue = getStatue2 
    end 

    if item.itemid == 3697 then 
        if findItem(3698, getStatue1.itemid, getStatue2.itemid) then 
            if findItem(1354, getStone1.itemid, getStone2.itemid, getStone3.itemid) then 
                doRemoveItem(getStone1.uid, 1) 
                doRemoveItem(getStone2.uid, 1)  
                doRemoveItem(getStone3.uid, 1) 
            end 
        end
		doChangeItemid(getStatue)
    elseif item.itemid == 3698 then 
        if not findItem(1354, getStone1.itemid, getStone2.itemid, getStone3.itemid) then 
            doCreateItem(1354, 1, stone1Pos) 
            doCreateItem(1354, 1, stone2Pos) 
            doCreateItem(1354, 1, stone3Pos) 
        end 
		doChangeItemid(getStatue, -1) 
    end 
    return TRUE 
end 

function doChangeItemid(item, value) 
    doTransformItem(item.uid, item.itemid + value or 1) 
end 

function findItem(itemid, ...) 
    for _, compareItemid in pairs(arg) do 
        if compareItemid ~= itemid then 
            return false
        end 
    end 
    return true
end
 
I think the positions and stuff are wrong ;<

Hard for me to find the errors, I don't know what positions are correct, cuz it seems to me like the item is not found!
 
I will give the positons another try, else I will have to find out another action to enter the teleport :/

EDIT: Didnt work :/
Got any idea of any idea else to enter the teleport? :\
 
Last edited:
Okay lemme think now...

The itemid is 3697 when you try to click on it FIRST TIME and by that moment the stones DOES exist?
 
Fully true

enter_mine.jpg
 
Well, I can tell you the stone positions is NOT:
PHP:
local stone1Pos = {x=403, y=121, z=8, stackpos=1}	
local stone2Pos = {x=404, y=122, z=8, stackpos=1}	
local stone3Pos = {x=405, y=123, z=8, stackpos=1}

!!!!

What are the real stone positions?


Edit:
Calculated:
PHP:
local stone1Pos = {x=403, y=121, z=8, stackpos=1}	
local stone2Pos = {x=404, y=121, z=8, stackpos=1}	
local stone3Pos = {x=405, y=121, z=8, stackpos=1}

Right?
 
Well, I can tell you the stone positions is NOT:
PHP:
local stone1Pos = {x=403, y=121, z=8, stackpos=1}	
local stone2Pos = {x=404, y=122, z=8, stackpos=1}	
local stone3Pos = {x=405, y=123, z=8, stackpos=1}

!!!!

What are the real stone positions?
local stone1Pos = {x=403, y=121, z=8, stackpos=1}
local stone2Pos = {x=404, y=121, z=8, stackpos=1}
local stone3Pos = {x=405, y=121, z=8, stackpos=1}

You messed the positions arround but I fixed em every time, so thats not the problem :(
 
ahh just try it, idk:
PHP:
local statue1Pos = {x=409, y=108, z=8, stackpos=253}	
local statue2Pos = {x=400, y=108, z=8, stackpos=253}	

local stone1Pos = {x=403, y=121, z=8, stackpos=1}	
local stone2Pos = {x=404, y=121, z=8, stackpos=1}	
local stone3Pos = {x=405, y=121, z=8, stackpos=1}	

function onUse(cid, item, frompos, topos)	
	local getStatue1 = getThingfromPos(statue1Pos)	
	local getStatue2 = getThingfromPos(statue2Pos)	

	local getStone1 = getThingfromPos(stone1Pos)	
	local getStone2 = getThingfromPos(stone1Pos)	
	local getStone3 = getThingfromPos(stone1Pos)	

	if item.uid == 3697 then	
		local getStatue = getStatue1	
	elseif item.uid == 3698 then	
		local getStatue = getStatue2	
	end	

	if item.itemid == 3697 then	
		if findItem(3698, getStatue1.itemid, getStatue2.itemid) then	
			if findItem(1354, getStone1.itemid, getStone2.itemid, getStone3.itemid) then	
				doRemoveItem(getStone1.uid, 1)	
				doRemoveItem(getStone2.uid, 1)	 
				doRemoveItem(getStone3.uid, 1)	
			end	
		end 
		doChangeItemid(getStatue) 
	elseif item.itemid == 3698 then	
		if not findItem(1354, getStone1.itemid, getStone2.itemid, getStone3.itemid) then	
			doCreateItem(1354, 1, stone1Pos)	
			doCreateItem(1354, 1, stone2Pos)	
			doCreateItem(1354, 1, stone3Pos)	
		end	
		doChangeItemid(getStatue, -1)	
	end	
	return TRUE	
end	

function doChangeItemid(item, value)	
	doTransformItem(item.uid, item.itemid + value or 1)	
end	

function findItem(itemid, ...)	
	for _, compareItemid in pairs(arg) do	
		if compareItemid ~= itemid then	
			return false 
		end	
	end	
	return true 
end

im off for now, if it doesn't work i'll be back 2morrow!
 
Back
Top