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

Two Actions

I r New

New Member
Joined
Feb 1, 2008
Messages
137
Reaction score
1
What I would like is:

1; Use an item, say... shovel on a pillar and it teleports you to X, Y, Z

2: Can't enter a door without a specific item in your backpack. Also a specific level.

Thankyou, :)
 
1)
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {x=666, y=666, z=7}
if itemEx.actionid == 1277 then
doTeleportThing(cid, pos)
end
return true
end

2)
PHP:
function onStepIn(cid, item, position, fromPosition)
 
	local newPos = {x = 33427, y = 31829, z = 13}
	local vocation = {2, 6, 10}
        local lvl = {100}
 
	if(isInArray(vocation, getPlayerVocation(cid)) and doPlayerRemoveItem(cid, 7761, 20) == true) and getPlayerLevel(cid, lvl) then
		doTeleportThing(cid, newPos)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) 
	else
		doTeleportThing(cid, fromPosition)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_ENERGYHIT)
		doPlayerSendTextMessage(0, cid, 22, 'Only druids with 20 enchanted small emeralds and 100 level may enter here.') 
	end
end
 
Number one is right on the money
I'll explain number two some more.

You have to have say.. Pirate legs in your backpack to enter a spawn. It won't take the pirate legs upon entry. No need for the vocation though either.
Thank you though. :)
 
Lua:
function onStepIn(cid, item, position, fromPosition)
 
    local newPos = {x = 33427, y = 31829, z = 13}
        local lvl = {100}
 
    if(isInArray(getPlayerItem(cid, 7761) == true) and getPlayerLevel(cid, lvl) then
        doTeleportThing(cid, newPos)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) 
    else
        doTeleportThing(cid, fromPosition)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_ENERGYHIT)
        doPlayerSendTextMessage(0, cid, 22, 'Dude, you cannot enter there! You must take off your pirate pants to backpack and have 100 level.') 
    end
end
 
Lua:
function onStepIn(cid, item, position, fromPosition)
 
    local newPos = {x = 33427, y = 31829, z = 13}
        local lvl = {100}
 
    if(isInArray(getPlayerItem(cid, 7761) == true) and getPlayerLevel(cid, lvl) then
        doTeleportThing(cid, newPos)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) 
    else
        doTeleportThing(cid, fromPosition)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_ENERGYHIT)
        doPlayerSendTextMessage(0, cid, 22, 'Dude, you cannot enter there! You must take off your pirate pants to backpack and have 100 level.') 
    end
end

The array is not needed there, lol.

Lua:
local t,l,i = {x = 33427, y = 31829, z = 13},100,7761
function onStepIn(cid,item,topos,itemEx,frompos)
local v = getThingPos(cid)
	if getPlayerItemCount(cid,i) > 0 then
		if getPlayerLevel(cid) >= l then
			doTeleportThing(cid,t)
			doSendMagicEffect(t,CONST_ME_TELEPORT)
		else
			doTeleportThing(cid,frompos)
			doPlayerSendTextMessage(cid,MESSAGE_LAST,'You need to be level 100.')
			doSendMagicEffect(v,CONST_ME_POFF)
		end
	else
		doPlayerSendTextMessage(cid,MESSAGE_LAST,'You must have pirate legs to enter the teleport.')
		doTeleportThing(cid,frompos)
		doSendMagicEffect(v,CONST_ME_POFF)
	end
	return true
end
 
Last edited:
Back
Top