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

Very hard movement, possible? (solved)

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,857
Reaction score
96
Location
Brazil
I have this door:
inqis.jpg


The script is:
1. Only player with storage 51692 can enter.
2. Player can leave only if have storage 8560.
3. Players can't enter again.
 
LUA:
local storage = 8560

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if 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, "aaaa.")

		else
			doTeleportThing(cid, {x = 32320, y = 32259, z = 9}, false)
			doSendMagicEffect(getCreaturePosition(cid),10)
			doPlayerSendCancel(cid, "Bbbbbb.")
		end
	
	elseif 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, "ccccc.")
		end

		else
			doTeleportThing(cid, {x = 32320, y = 32259, z = 9}, false)
			doSendMagicEffect(getCreaturePosition(cid),10)
			doPlayerSendCancel(cid, "ddddd.")
	
		end
	
	 if getCreatureStorage(cid, storage) > 0 then
			if getCreaturePosition(cid).y > toPosition.y then
			doTeleportThing(cid, {x = 32320, y = 32259, z = 9}, false)
			doSendMagicEffect(getCreaturePosition(cid),10)
			doPlayerSendCancel(cid, "eeeeee.")
		end


	end
 
	return true
end

I tried this, but don't work :S
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorage(cid, 8560) == true 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, "addon.")

		else
			doTeleportThing(cid, {x = 32320, y = 32257, z = 9}, false)
			doSendMagicEffect(getCreaturePosition(cid),10)
			doPlayerSendCancel(cid, "You cant go out yet.")
		end
	
	elseif getPlayerStorage(cid, 8560) == true then
			if getCreaturePosition(cid).y > toPosition.y then
			doSendMagicEffect(getCreaturePosition(cid),10)
			doPlayerSendCancel(cid, "already done.")
		end

		else
			doTeleportThing(cid, {x = 32320, y = 32259, z = 9}, false)
			doSendMagicEffect(getCreaturePosition(cid),10)
			doPlayerSendCancel(cid, "you must make this quest.")
	
		end
	
	 if getPlayerStorage(cid, 51692) == true 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, "eeeeee.")
		end


	end
 
	return true
end

Do not work yet
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreaturePosition(cid).y > toPosition.y then
		if getCreatureStorage(cid, 51692) == 1 then
			if getCreatureStorage(cid, 8560) == -1 then
				toPosition.y = toPosition.y - 1
				doTeleportThing(cid, toPosition)
				doSendMagicEffect(toPosition, 10)
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You can\'t enter again.')
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'The door seems to be sealed against unwanted intruders.')
		end
	elseif getCreatureStorage(cid, 8560) == 1 then
		toPosition.y = toPosition.y + 1
		doTeleportThing(cid, toPosition)
		doSendMagicEffect(toPosition, 10)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You can\'t leave yet.')
	end
	return true
end
And stop making threads with "hard" in their name, none of the stuff you requested is hard
 
Back
Top