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

Who can change this script for me? <DONE Very Thanks to Quas>

lajrek34a

New Member
Joined
Sep 15, 2009
Messages
117
Reaction score
0
It work 100%

-- rewritten by QuaS~

--Unique ids used;
--Id of main lever = 8080

local tpid = 1387 --id of the teleporter that will be created.
local tppos = {x=1000,y=1000,z=7,stackpos=1} -- place where the teleporter with id =1387 will be created in.
local tpto = {x=1000,y=1000,z=7} --place where player will be teleported to when he enter the tp.
local timee = 10 -- time to remove portal in seconds

local levers = {
[1] = {id = 1946, pos = {x=1000, y=1000, z=7, stackpos=1}}, --Position of First Lever.
[2] = {id = 1946, pos = {x=1000, y=1000, z=7, stackpos=1}}, --Position of Second Lever.
[3] = {id = 1945, pos = {x=1000, y=1000, z=7, stackpos=1}},--Position of Third Lever.
[4] = {id = 1945, pos = {x=1000, y=1000, z=7, stackpos=1}}, --Position of Fourth Lever.
[5] = {id = 1946, pos = {x=1000, y=1000, z=7, stackpos=1}}, --Position of Fifth Lever.
[6] = {id = 1946, pos = {x=1000, y=1000, z=7, stackpos=1}}, --Position of Sixth Lever
[7] = {id = 1946, pos = {x=1000, y=1000, z=7, stackpos=1}} -- MAIN
}


function removePortal_levers() -- changed name to prevent to use this function in another script due popular name.
if getTileItemById(tppos, tpid).itemid > 0 then
doRemoveItem(getTileItemById(tppos, tpid).uid,1)
end
for i=1,#levers do
if getTileItemById(levers.pos,1946).itemid > 0 then
doTransformItem(getTileItemById(levers.pos,1946).uid,1945)
end
end
return TRUE
end



function onUse(cid, item, fromPosition, itemEx, toPosition)
local doit = true
for i = 1,6 do
if doit then
if getTileItemById(levers.pos,levers.id).itemid > 0 then
doit = true
else
doit = false
end
else
break
end
end

if item.uid == 8080 then
if item.itemid == 1945 then
if doit then
doCreateTeleport(tpid, tpto, tppos)
doPlayerSendTextMessage(cid,22,"A portal is created and will be removed in "..timee.." sec.")
addEvent(removePortal_levers,(timee*1000))
doTransformItem(item.uid,item.itemid+1)
else
doPlayerSendTextMessage(cid,22,"Levers have to be in correct configuration to open a portal.")
end
elseif item.itemid == 1946 then
doPlayerSendTextMessage(cid,22,"You can not stop running proccess.")
end
end
return TRUE
end
 
Last edited:
Here u r

Rep++ if it helped :)

Code:
--Script made by 70% Dizzy, 30% Maizor

--Unique ids used;
--Id of main lever = 8080
pos = {x=1000, y=1000, z=7}

function onUse(cid, item, frompos, item2, topos)
if item.uid == 8080 then

--Config
stairid = 1385 --ID of the stairs you want to use.
mainlever = {x=1000, y=1000, z=7, stackpos=1} --Position of the lever that i sused to check if all other levers are in place.
leverpos1 = {x=1000, y=1000, z=7, stackpos=1} --Position of First Lever.
leverpos2 = {x=1000, y=1000, z=7, stackpos=1} --Position of Second Lever.
leverpos3 = {x=1000, y=1000, z=7, stackpos=1} --Position of Third Lever.
leverpos4 = {x=1000, y=1000, z=7, stackpos=1} --Position of Fourth Lever.
leverpos5 = {x=1000, y=1000, z=7, stackpos=1} --Position of Fifth Lever.
leverpos6 = {x=1000, y=1000, z=7, stackpos=1} --Position of Sixth Lever.
stairpos = {x=1000, y=1000, z=7, stackpos=1} --Position where stairs will be created.
stairpos1 = {x=1000, y=1000, z=7} --Position where stairs will be created.(Needed for script purposes]
--End Config

stair = getThingfromPos(stairpos)
trigger = getThingfromPos(mainlever)
lever1 = getThingfromPos(leverpos1)
lever2 = getThingfromPos(leverpos2)
lever3 = getThingfromPos(leverpos3)
lever4 = getThingfromPos(leverpos4)
lever5 = getThingfromPos(leverpos5)
lever6 = getThingfromPos(leverpos6)

--[right][right][left][right][left][left]--

if item.itemid == 1945 then
doTransformItem(item.uid,1946)
elseif item.itemid == 1946 then
doTransformItem(item.uid,1945)

end

if (item.uid == 8080 and item.itemid == 1945 and lever1.itemid == 1946 and lever2.itemid == 1946 and lever3.itemid == 1945 and lever4.itemid == 1946 and lever5.itemid == 1945 and lever6.itemid == 1945 and stair.itemid == 0) then
doTeleportThing(cid,pos)
doSendMagicEffect(pos, 10)
doTransformItem(item.uid,1946)
elseif (item.uid == 8080 and item.itemid == 1946 and lever1.itemid == 1946 and lever2.itemid == 1946 and lever3.itemid == 1945 and lever4.itemid == 1946 and lever5.itemid == 1945 and lever6.itemid == 1945 and stair.itemid == stairid) then
doTransformItem(item.uid,1945)
end
end
end

dont forget to add your position that u wanna tp to in this

Code:
pos = {x=, y=, z=}
 
how add reset?

Change this script please.. add doPlayerSendCancel(cid,"Sorry, not possible.") -- message if the lever is pulled again.
I don't know where put it... and... i givu you repp :)
--Script written by Rooteh
local Q_Switches = {
[4000] = 1946, ----- [Unique ID] = Item ID
[4001] = 1945,
[4002] = 1946,
[4003] = 1945,
[4004] = 1946,
[4005] = 1945,
[4006] = 1946,

}
local function resettq1(item, getstatue, statue)
doCreateItem(getstatue.itemid, 1, statue)
for key, value in pairs(Q_Switches) do
if (getTileThingByPos((getThingPos(key))).itemid == 1946) then


doTransformItem(key, 1945)
end
end
end
function onUse(cid, item, item2, frompos, topos)
local statue = {x=253, y=96, z=9, stackpos=1}
local getstatue = getTileItemById(statue, 1449)
local timeToReset = 20000
for i, v in pairs(Q_Switches) do
if not (getTileThingByPos((getThingPos(i))).itemid == v) then
if item.itemid == 1945 then
doTransformItem(item.uid, 1946)
else
doTransformItem(item.uid, 1945)
end
return true
end
end
if item.itemid == 1945 then
doTransformItem(item.uid, 1946)

else

doTransformItem(item.uid, 1945)
end


doCreatureSay(cid, "A statue opened a hidden place. Hurry it\'s only opened for 10 seconds!", TALKTYPE_ORANGE_1)
doRemoveItem(getstatue.uid, 1)
addEvent(resettq1, timeToReset, item, getstatue, statue)
return true
end
 
Hope it work :D
Code:
--Script written by Rooteh
local Q_Switches = {
[4000] = 1946, ----- [Unique ID] = Item ID
[4001] = 1945,
[4002] = 1946,
[4003] = 1945,
[4004] = 1946,
[4005] = 1945,
[4006] = 1946,

}
local function resettq1(item, getstatue, statue)
doCreateItem(getstatue.itemid, 1, statue)
for key, value in pairs(Q_Switches) do
if (getTileThingByPos((getThingPos(key))).itemid == 1946) then


doTransformItem(key, 1945)
end
end
end
function onUse(cid, item, item2, frompos, topos)
quest = getPlayerStorageValue(cid,11221)
local statue = {x=253, y=96, z=9, stackpos=1}
local getstatue = getTileItemById(statue, 1449)
local timeToReset = 20000
for i, v in pairs(Q_Switches) do
if not (getTileThingByPos((getThingPos(i))).itemid == v) then
if item.itemid == 1945 then
doTransformItem(item.uid, 1946)
setPlayerStorageValue(cid,11221,1)
else
doTransformItem(item.uid, 1945)
end
return true
end
end
if item.itemid == 1945 and quest == 1 then
doTransformItem(item.uid, 1946)
doPlayerSendCancel(cid,"Sorry, not possible.")

else

doTransformItem(item.uid, 1945)
end


doCreatureSay(cid, "A statue opened a hidden place. Hurry it\'s only opened for 10 seconds!", TALKTYPE_ORANGE_1)
doRemoveItem(getstatue.uid, 1)
addEvent(resettq1, timeToReset, item, getstatue, statue)
return true
end
 
@up not work beacause when stone is removed i can use lever and is bug in console
[06/11/2009 07:39:39] Lua Script Error: [Action Interface]
[06/11/2009 07:39:39] in a timer event called from:
[06/11/2009 07:39:39] data/actions/scripts/solarlever.lua:eek:nUse

[06/11/2009 07:39:39] luaDoCreateItem(). Item not found
 
first i dont get you what you want to be done? when all levers are pulled in the right way a portal appear in a place and be removed after a definite time?(if that what u want then this is here)
ok try this and tell me if there is errors

Lua:
--Script made by 70% Dizzy, 30% Maizor
--- edited by Damadgerz

--Unique ids used;
--Id of main lever = 8080

local tpid = 1387   --id of the teleporter that will be created.
local tppos = {x=xxxx,y=xxxx,z=x,stackpos=1}  -- place where the teleporter with id =1387 will be created in.
local tpto = {x=xxxx,y=xxxx,z=x}  --place where player will be teleported to when he enter the tp.
local timee = 10  -- time to remove portal in seconds

function onUse(cid, item, frompos, item2, topos)
   --Config

mainlever = {x=1000, y=1000, z=7, stackpos=1} --Position of the lever that i sused to check if all other levers are in place.
leverpos1 = {x=1000, y=1000, z=7, stackpos=1} --Position of First Lever.
leverpos2 = {x=1000, y=1000, z=7, stackpos=1} --Position of Second Lever.
leverpos3 = {x=1000, y=1000, z=7, stackpos=1} --Position of Third Lever.
leverpos4 = {x=1000, y=1000, z=7, stackpos=1} --Position of Fourth Lever.
leverpos5 = {x=1000, y=1000, z=7, stackpos=1} --Position of Fifth Lever.
leverpos6 = {x=1000, y=1000, z=7, stackpos=1} --Position of Sixth Lever.

--End Config

portal = getThingfromPos(tppos)
trigger = getThingfromPos(mainlever)
lever1 = getThingfromPos(leverpos1)
lever2 = getThingfromPos(leverpos2)
lever3 = getThingfromPos(leverpos3)
lever4 = getThingfromPos(leverpos4)
lever5 = getThingfromPos(leverpos5)
lever6 = getThingfromPos(leverpos6)

--[right][right][left][right][left][left]--


  if (item.uid == 8080 and item.itemid == 1945 and lever1.itemid == 1946 and lever2.itemid == 1946 and lever3.itemid == 1945 and lever4.itemid == 1946 and lever5.itemid == 1945 and lever6.itemid == 1945 and portal.itemid ~= tpid) then
      doCreateTeleport(tpid, tpto, tppos)
      doPlayerSendTextMessage(cid,22,"A portal is created and will be removed in "..timee.." sec.")
      addEvent(removePortal,(timee*1000))
     
  end
end  
function removePortal()
	if getThingfromPos(tppos).itemid == 1387 then
	   doRemoveItem(getThingfromPos(tppos).uid,1)
	return TRUE
	end
end


I guess you will find instruction needed inside script.
 
Last edited:
Ok all is nice but .. after 10 seconds portal not disapear and lever do not reset :(

Maybe you must add ID of lever too?

[4000] = 1946, ----- [Unique ID] = Item ID
[4001] = 1945,
[4002] = 1946,
[4003] = 1945,
[4004] = 1946,
[4005] = 1945,
[4006] = 1946,

}

:(
 
Last edited:
look try now.and what do u mean by lever reset>??.this makes when u pull lever it just turn to 1946 randomly and tp will disappear.
 
questk.png


In my first script is function back all lever after 10 seconds to id 1945
 
Last edited:
tell me if there is errors
Lua:
--Script made by 70% Dizzy, 30% Maizor
--- edited by Damadgerz

--Unique ids used;
--Id of main lever = 8080

local tpid = 1387   --id of the teleporter that will be created.
local tppos = {x=xxxx,y=xxxx,z=x,stackpos=1}  -- place where the teleporter with id =1387 will be created in.
local tpto = {x=xxxx,y=xxxx,z=x}  --place where player will be teleported to when he enter the tp.
local timee = 10  -- time to remove portal in seconds


local mainlever = {x=1000, y=1000, z=7, stackpos=1} --Position of the lever that i sused to check if all other levers are in place.
local lev1 = {x=1000, y=1000, z=7, stackpos=1} --Position of First Lever.
local lev2 = {x=1000, y=1000, z=7, stackpos=1} --Position of Second Lever.
local lev3 = {x=1000, y=1000, z=7, stackpos=1} --Position of Third Lever.
local lev4 = {x=1000, y=1000, z=7, stackpos=1} --Position of Fourth Lever.
local lev5 = {x=1000, y=1000, z=7, stackpos=1} --Position of Fifth Lever.
local lev6 = {x=1000, y=1000, z=7, stackpos=1} --Position of Sixth Lever

function onUse(cid, item, frompos, item2, topos)


portal = getThingfromPos(tppos)
trigger = getThingfromPos(mainlever)
lever1 = getThingfromPos(leverpos1)
lever2 = getThingfromPos(leverpos2)
lever3 = getThingfromPos(leverpos3)
lever4 = getThingfromPos(leverpos4)
lever5 = getThingfromPos(leverpos5)
lever6 = getThingfromPos(leverpos6)

--[right][right][left][right][left][left]--


  if (item.uid == 8080 and item.itemid == 1945 and lever1.itemid == 1946 and lever2.itemid == 1946 and lever3.itemid == 1945 and lever4.itemid == 1946 and lever5.itemid == 1945 and lever6.itemid == 1945 and portal.itemid ~= tpid) then
      doCreateTeleport(tpid, tpto, tppos)
      doPlayerSendTextMessage(cid,22,"A portal is created and will be removed in "..timee.." sec.")
      addEvent(removePortal,(timee*1000))
     
  end
end  
function removePortal()
        if getThingfromPos(tppos).itemid == 1387 then
           doRemoveItem(getThingfromPos(tppos).uid,1)
		   doRemoveItem(getThingfromPos(mainlever).uid,1)
		   doCreatItem(1945,1,mainlever)
		   		   doRemoveItem(getThingfromPos(lev1).uid,1)
		   doCreatItem(1945,1,lev1)
		   		   doRemoveItem(getThingfromPos(lev2).uid,1)
		   doCreatItem(1945,1,lev2)
		   		   doRemoveItem(getThingfromPos(lev3).uid,1)
		   doCreatItem(1945,1,lev3)
		   		   doRemoveItem(getThingfromPos(lev4).uid,1)
		   doCreatItem(1945,1,lev4)
		   		   doRemoveItem(getThingfromPos(lev5).uid,1)
		   doCreatItem(1945,1,lev5)
		   		   doRemoveItem(getThingfromPos(lev6).uid,1)
		   doCreatItem(1945,1,lev6)
		   
        return TRUE
        end
end
 
Last edited:
Not work now :< error in console

[07/11/2009 17:05:24] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/solarq.lua)
[07/11/2009 17:05:24] data/actions/scripts/solarq.lua:64: '<eof>' expected near 'end'

Edit
I will give you rep for your time spent on changing the script but still not working as it should be because they do not reset the lever :(
 
Last edited:
try it now i just mistaked added unnessecary <end>
try this
Lua:
--Script made by 70% Dizzy, 30% Maizor
--- edited by Damadgerz

--Unique ids used;
--Id of main lever = 8080

local tpid = 1387   --id of the teleporter that will be created.
local tppos = {x=xxxx,y=xxxx,z=x,stackpos=1}  -- place where the teleporter with id =1387 will be created in.
local tpto = {x=xxxx,y=xxxx,z=x}  --place where player will be teleported to when he enter the tp.
local timee = 10  -- time to remove portal in seconds


local mainlever = {x=1000, y=1000, z=7, stackpos=1} --Position of the lever that i sused to check if all other levers are in place.
local lev1 = {x=1000, y=1000, z=7, stackpos=1} --Position of First Lever.
local lev2 = {x=1000, y=1000, z=7, stackpos=1} --Position of Second Lever.
local lev3 = {x=1000, y=1000, z=7, stackpos=1} --Position of Third Lever.
local lev4 = {x=1000, y=1000, z=7, stackpos=1} --Position of Fourth Lever.
local lev5 = {x=1000, y=1000, z=7, stackpos=1} --Position of Fifth Lever.
local lev6 = {x=1000, y=1000, z=7, stackpos=1} --Position of Sixth Lever

function onUse(cid, item, frompos, item2, topos)


portal = getThingfromPos(tppos)
trigger = getThingfromPos(mainlever)
lever1 = getThingfromPos(leverpos1)
lever2 = getThingfromPos(leverpos2)
lever3 = getThingfromPos(leverpos3)
lever4 = getThingfromPos(leverpos4)
lever5 = getThingfromPos(leverpos5)
lever6 = getThingfromPos(leverpos6)

--[right][right][left][right][left][left]--


  if (item.uid == 8080 and item.itemid == 1945 and lever1.itemid == 1946 and lever2.itemid == 1946 and lever3.itemid == 1945 and lever4.itemid == 1946 and lever5.itemid == 1945 and lever6.itemid == 1945 and portal.itemid ~= tpid) then
      doCreateTeleport(tpid, tpto, tppos)
      doPlayerSendTextMessage(cid,22,"A portal is created and will be removed in "..timee.." sec.")
      addEvent(removePortal,(timee*1000))
     
  end
end  
function removePortal()
        if getThingfromPos(tppos).itemid == 1387 then
           doRemoveItem(getThingfromPos(tppos).uid,1)
                   doRemoveItem(getThingfromPos(mainlever).uid,1)
                   doCreatItem(1945,1,mainlever)
                                   doRemoveItem(getThingfromPos(lev1).uid,1)
                   doCreatItem(1945,1,lev1)
                                   doRemoveItem(getThingfromPos(lev2).uid,1)
                   doCreatItem(1945,1,lev2)
                                   doRemoveItem(getThingfromPos(lev3).uid,1)
                   doCreatItem(1945,1,lev3)
                                   doRemoveItem(getThingfromPos(lev4).uid,1)
                   doCreatItem(1945,1,lev4)
                                   doRemoveItem(getThingfromPos(lev5).uid,1)
                   doCreatItem(1945,1,lev5)
                                   doRemoveItem(getThingfromPos(lev6).uid,1)
                   doCreatItem(1945,1,lev6)
                   
        return TRUE
        end
end
 
Last edited:
@allAbove. You are just pathentic -_-.. guy asked for simple script and you are trying to build a skyscraper..

take.

Lua:
-- rewritten by QuaS~

--Unique ids used;
--Id of main lever = 8080

local tpid = 1387   --id of the teleporter that will be created.
local tppos = {x=1000,y=1000,z=7,stackpos=1}  -- place where the teleporter with id =1387 will be created in.
local tpto = {x=1000,y=1000,z=7}  --place where player will be teleported to when he enter the tp.
local timee = 10  -- time to remove portal in seconds

local levers = {
[1] = {id = 1946, pos = {x=1000, y=1000, z=7, stackpos=1}}, --Position of First Lever.
[2] = {id = 1946, pos = {x=1000, y=1000, z=7, stackpos=1}}, --Position of Second Lever.
[3] = {id = 1945, pos = {x=1000, y=1000, z=7, stackpos=1}},--Position of Third Lever.
[4] = {id = 1945, pos = {x=1000, y=1000, z=7, stackpos=1}}, --Position of Fourth Lever.
[5] = {id = 1946, pos = {x=1000, y=1000, z=7, stackpos=1}}, --Position of Fifth Lever.
[6] = {id = 1946, pos = {x=1000, y=1000, z=7, stackpos=1}}, --Position of Sixth Lever
[7] = {id = 1946, pos = {x=1000, y=1000, z=7, stackpos=1}}  -- MAIN
}


function removePortal_levers()  -- changed name to prevent to use this function in another script due popular name.
	if getTileItemById(tppos, tpid).itemid  > 0 then
	   doRemoveItem(getTileItemById(tppos, tpid).uid,1)
	end
	for i=1,#levers do
		if getTileItemById(levers[i].pos,1946).itemid > 0 then
			doTransformItem(getTileItemById(levers[i].pos,1946).uid,1945)
		end
	end
	return TRUE		
end



function onUse(cid, item, fromPosition, itemEx, toPosition)
local doit = true
	for i = 1,6 do
		if doit then
			if getTileItemById(levers[i].pos,levers[i].id).itemid > 0 then
				doit = true
			else
				doit = false
			end
		else
			break
		end
	end
	
	if item.uid == 8080 then
		if item.itemid == 1945 then
			if doit then
				doCreateTeleport(tpid, tpto, tppos)
				doPlayerSendTextMessage(cid,22,"A portal is created and will be removed in "..timee.." sec.")
				addEvent(removePortal_levers,(timee*1000))
				doTransformItem(item.uid,item.itemid+1)
			else
				doPlayerSendTextMessage(cid,22,"Levers have to be in correct configuration to open a portal.")
			end
		elseif item.itemid == 1946 then
			doPlayerSendTextMessage(cid,22,"You can not stop running proccess.")
		end
	end
	return TRUE
end

Regards. QuaS~
 
Last edited:
Back
Top