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

Enter a door when you are...

Donio

Banned User
Joined
Jun 24, 2008
Messages
4,004
Reaction score
16
Location
Manhattan, New York
Hello, im creating a new quest on my server, and Im trying to figure out how I can do so a Knight can enter a door for his vocation, a Paladin for his vocation, a druid for his vocation and a sorc for his vocation, and at the same time be level 450.. Does anyone know if that is possible? If so please help me out here :)
 
This is for the knight.
The rest you can figure out yourself =)
LUA:
if getplayervocation(cid) == 4 and getplayerlevel(cid) >= 450 or getplayervocation(cid) == 4 and getplayerlevel(cid) >= 450 then

or use similar
LUA:
if getplayervocation(cid) == 4 or getplayervocation(cid) == 8 then
	if getPlayerLevel(cid) >= 450 then
	** <-- Door action here
	else
	doPlayerSendTextMessage(cid, 22, "Only players with level 450 or above may pass!")
	end
else
doPlayerSendTextMessage(cid, 22, "Only knights may pass!")
end
 
can I do something like:

Code:
if getplayervocation(cid) == 4 or getplayervocation(cid) == 8 then
	if getPlayerLevel(cid) >= 450 then
	** <-- Door action here
	else
	doPlayerSendTextMessage(cid, 22, "Only players with level 450 or above may pass!")
	end
else
doPlayerSendTextMessage(cid, 22, "Only druids may pass!")
if getplayervocation(cid) == 2 or getplayervocation(cid) == 5 then
	if getPlayerLevel(cid) >= 450 then
	** <-- Door action here
	else
	doPlayerSendTextMessage(cid, 22, "Only players with level 450 or above may pass!")
	end
else
doPlayerSendTextMessage(cid, 22, "Only druids may pass!")
end

add 4 vocs in the same script.. and door id somthing like:

Code:
<action uniqueid="DOOR ID" script="vocdoor/Questname.lua" />

`?
 
@Donio
you messed every thing up

this is realsoft script just editing it for you.
** <-- Door action here where you see this message there you most put your own action like teleport them to a location or some thing

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getplayervocation(cid) == 1 or getplayervocation(cid) == 5 and getPlayerLevel(cid) >= 450 then
	** <-- Door action here
	else
	doPlayerSendTextMessage(cid, 22, "Only Sorcerer level 450 may enter here!")
	end
else if getplayervocation(cid) == 2 or getplayervocation(cid) == 6 and getPlayerLevel(cid) >= 450 then
	** <-- Door action here
	else
	doPlayerSendTextMessage(cid, 22, "Only Druid level 450 may enter here!")
	end
else if getplayervocation(cid) == 3 or getplayervocation(cid) == 7 and getPlayerLevel(cid) >= 450 then
	** <-- Door action here
	else
	doPlayerSendTextMessage(cid, 22, "Only Paladin level 450 may enter here!")
	end
else if getplayervocation(cid) == 4 or getplayervocation(cid) == 8 and getPlayerLevel(cid) >= 450 then
	** <-- Door action here
	else
	doPlayerSendTextMessage(cid, 22, "Only Knights level 450 may enter here!")
	end
    return TRUE
end
 
with "**<-- Door action here", Donio, is that place, you must put whatever will happen when a player use the door.
etc, will the door open? will the player move in to that sqm with the door? or will the player be teleported? or anything...

You must have some sort of action at those ** what's going to happen, else nothing will happen, the only thing will happen with that script as it's now, is a "You may not pass" message to the other vocations that may not pass..

hope you got that =)
 
i told him that maby if he tell us what he want to do with the charachter then we can add it for him.
like teleport location for every voc
 
with "**<-- Door action here", Donio, is that place, you must put whatever will happen when a player use the door.
etc, will the door open? will the player move in to that sqm with the door? or will the player be teleported? or anything...

You must have some sort of action at those ** what's going to happen, else nothing will happen, the only thing will happen with that script as it's now, is a "You may not pass" message to the other vocations that may not pass..

hope you got that =)

As you said he will open the door and then the player moves in to that sqm with the door its like this:

2w4mgpj.jpg


They will move 1 sqm into the tp. So they can continue to the next level. I hope the pictuture made it more clear!
 
i ill make the script liek when the use the door they will be teleported to the location of the teleports and all the door can have the same uniqeID

give me this :
Knight teleport location =
Druid teleport location =
Sorcerer teleport location =
Paladin teleport location =
 
Here test this but first make all doors action id = 1229

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.actionID== 1229) then
if getplayervocation(cid) == 1 or getplayervocation(cid) == 5 and getPlayerLevel(cid) >= 450 then
	doTeleportThing(cid, {x = 1052, y = 833, z = 11})
	doSendMagicEffect(v,10)
	else
	doPlayerSendTextMessage(cid, 22, "Only Sorcerer level 450 may enter here!")
	end
else if getplayervocation(cid) == 2 or getplayervocation(cid) == 6 and getPlayerLevel(cid) >= 450 then
	doTeleportThing(cid, {x = 1038, y = 847, z = 11})
	doSendMagicEffect(v,10)
	else
	doPlayerSendTextMessage(cid, 22, "Only Druid level 450 may enter here!")
	end
else if getplayervocation(cid) == 3 or getplayervocation(cid) == 7 and getPlayerLevel(cid) >= 450 then
	doTeleportThing(cid, {x = 1037, y = 820, z = 11})
	doSendMagicEffect(v,10)
	else
	doPlayerSendTextMessage(cid, 22, "Only Paladin level 450 may enter here!")
	end
else if getplayervocation(cid) == 4 or getplayervocation(cid) == 8 and getPlayerLevel(cid) >= 450 then
	doTeleportThing(cid, {x = 1022, y = 833, z = 11})
	doSendMagicEffect(v,10)
	else
	doPlayerSendTextMessage(cid, 22, "Only Knights level 450 may enter here!")
	end
end
    return TRUE
end
 
Last edited:
sry my bad put the door ids in mapeditor actionID = 1229
and then in actions.xml
Code:
<action actionid="1229" event="script" value="vocDoors.lua" />

and change the script uniqueID to ActionID
 

Similar threads

Back
Top