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

Whats wrong with this script?

Tarielle

New Member
Joined
Nov 4, 2007
Messages
214
Reaction score
0
Location
Sweden
Why don't this script remove the teleport at the ending? What do I do wrong? Everything works except that the teleport wont dissapear when you pull the 1946 lever.

Code:
function onUse(cid, item, frompos, item2, topos)
thingpos = {x=2944, y=2499, z=9, stackpos=1}
getthing = getThingfromPos(thingpos)

tile1 = {x=2935, y=2523, z=9, stackpos=1} --change tilepos		
gettile1 = getThingfromPos(tile1)
		
local npos = {x=2971, y=2518, z=9}
if item.uid == 2012 and item.itemid == 1945 and getthing.itemid == 2639 then 
doTransformItem(item.uid,item.itemid+1)
doCreateTeleport(1387, npos, tile1)

elseif item.uid == 2012 and item.itemid == 1946 and getthing.itemid == 2639 then

local getTeleport = getThingfromPos(tile1) 
            if getTeleport.itemid == TELEPORT_ITEMID then 
                doRemoveItem(getTeleport.uid) 
                doTransformItem(item.uid,item.itemid-1)
end
end 
end
 
Last edited:
Code:
function onUse(cid, item, frompos, item2, topos)
	thingpos = {x=2944, y=2499, z=9, stackpos=1}
	getthing = getThingfromPos(thingpos)

	tile1 = {x=2935, y=2523, z=9, stackpos=1} --change tilepos		
	gettile1 = getThingfromPos(tile1)
		
	local npos = {x=2971, y=2518, z=9}
	
		if item.uid == 2012 and item.itemid == 1945 and getthing.itemid == 2639 then 
			doTransformItem(item.uid,item.itemid+1)
			doCreateTeleport(1387, npos, tile1)

		elseif item.uid == 2012 and item.itemid == 1946 and getthing.itemid == 2639 then
			doTransformItem(item.uid,item.itemid-1)
		 
		end

		local getTeleport = getThingfromPos(tile1)
                if getTeleport.itemid == TELEPORT_ITEMID then 
                        doRemoveItem(getTeleport.uid) 

		end
end

You can't start another loop without 'ending' the previous one...

Try it now, anything EDIT your post and i'll try to help.

@OTLand..

C'mon, make some code=lua plxor :p
 
Last edited:
Back
Top