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

2 requests (not so hard I think)

Spo teh pro

New Member
Joined
Jan 3, 2008
Messages
319
Reaction score
1
Hello. The first script I need is that when you use the key 2091 on the door 9279 you will be teleported to a X position and the key DISAPPEARS

Thanks and ofcourse rep++ :)
This is almost the last script I need for my long server project, I would appreciate when someone could help me :)

second script solved, thanks
 
Last edited:
first:
Lua:
 local door = 9279
local location = {x=1000,y=1000,z=7}

function onUse(cid, item, frompos, item2, topos) 
         if isItemDoor(door) and getPlayerItemCount(cid, 8978) >= 1 then
         doTeleportThing(cid, location)
         doRemoveItem(item.uid, 1) 
         else
         doPlayerSendCancel(cid, "You do not have the required key to pass through this door!"
      end
end
 
No error appears but it doesnt work
I used other key (golden key) 2091

this is the script I use at the moment
Code:
 local door = 9279
local location = {x=1254,y=1007,z=10}
 
function onUse(cid, item, frompos, item2, topos) 
         if isItemDoor(door) and getPlayerItemCount(cid, 2091) >= 1 then
         doTeleportThing(cid, location)
         doRemoveItem(item.uid, 1) 
         else
         doPlayerSendCancel(cid, "You do not have the required key to pass through this door!")
      end
end

and this I got in actions.xml
Code:
	<action itemid="2091" event="script" value="door1.lua"/>
	<action itemid="9279" event="script" value="door1.lua"/>
	<action uniqueid="2231" event="script" value="door1.lua"/>
	<action actionid="2231" event="script" value="door1.lua"/>

I know it's to much but I didnt really knew what to use really (I put on one door 2231 AID and on one 2231 UID)


And anyone could please script the second script?
I know maybe it's a bit hard :/

Thanks in advance
 
Maybe this?:
Lua:
local door = 9279
local location = {x=1254, y=1007, z=10}
function onUse(cid, item, fromPos, itemEx, toPos)
if itemEx.itemid == door then
doTeleportThing(cid, location)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You do not have the required key to pass through this door!")
end
return true
end
And in actions.xml this:
XML:
<action itemid="2091" event="script" value="door1.lua"/>
 
You must make the key and door have action id's that match.

Lua:
local pos = {x = 100, y = 100, z = 7}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.actionid == itemEx.actionid then
		if itemEx.itemid == 9279 then
			doRemoveItem(item.uid, 1)
			doTeleportThing(cid, pos, false)
		end
	end
 
	return true
end
 
Last edited:
Back
Top