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

Door without PZ

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
Hello,
I need a script:
If player do NOT have PZ he is teleported to position1.
If player have pz he is teleported to position2.



Maybe like this? I don't know :S
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureStorage(cid, pz) < 0 then
		if getCreaturePosition(cid).y < toPosition.x then
			doTeleportThing(cid, { x = toPosition.x, y = toPosition.y + 1, z = toPosition.z }, true)
		else
			doTeleportThing(cid, { x = toPosition.x, y = toPosition.y- 1 , z = toPosition.z }, true)
		end
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
 
	return true
end
 
Change

LUA:
if getCreatureStorage(cid, pz) < 0 then

To

LUA:
if not isPlayerPzLocked(cid) then

And change

LUA:
doTeleportThing(cid, { x = toPosition.x, y = toPosition.y + 1, z = toPosition.z }, true)

To

LUA:
doTeleportThing(cid, {x = 100, y = 100, z = 7}, false)
 
Ok, I made this:
If player do NOT have pz and if have storage he is teleported to position.

LUA:
local storage = 12162
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureStorage(cid, storage) == 12162 and isPlayerPzLocked(cid) == false then
			doTeleportThing(cid, {x = 32815, y = 32329, z = 8}, false)
			doSendMagicEffect(getCreaturePosition(cid),10)
		else
			doTeleportThing(cid, {x = 32815, y = 32327, z = 8}, false)
			doSendMagicEffect(getCreaturePosition(cid),10)
			doPlayerSendCancel(cid, "You have to finish this Quest and be out of blood to pass this door.")
		
	end
 
	return true
end

Do not working
 
Working 100% now.

LUA:
local storage = 12161

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isPlayerPzLocked(cid) and getCreatureStorage(cid, storage) > 0 then
		if getCreaturePosition(cid).y < toPosition.y then
			doTeleportThing(cid, { x = toPosition.x, y = toPosition.y + 1, z = toPosition.z }, true)
			doSendMagicEffect(getCreaturePosition(cid),10)

		else
			doTeleportThing(cid, {x = 32815, y = 32327, z = 8}, false)
			doSendMagicEffect(getCreaturePosition(cid),10)
		end
	
	elseif isPlayerPzLocked(cid) and getCreatureStorage(cid, storage) > 0 then
			if getCreaturePosition(cid).y < toPosition.y then
			doTeleportThing(cid, { x = toPosition.x, y = toPosition.y - 1, z = toPosition.z }, true)
			doSendMagicEffect(getCreaturePosition(cid),10)
			doPlayerSendCancel(cid, "Be out of blood to pass this door.")
		end

		else
			doTeleportThing(cid, {x = 32815, y = 32327, z = 8}, false)
			doSendMagicEffect(getCreaturePosition(cid),10)
			doPlayerSendCancel(cid, "You have to finish this Quest to pass this door.")
	
		end
	
	 if isPlayerPzLocked(cid) and getCreatureStorage(cid, storage) > 0 then
			if getCreaturePosition(cid).y > toPosition.y then
			doTeleportThing(cid, {x = 32815, y = 32329, z = 8}, false)
			doSendMagicEffect(getCreaturePosition(cid),10)
			doPlayerSendCancel(cid, "Be out of blood to pass this door.")
		end


	end
 
	return true
end
 
Last edited:
Back
Top