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

[Request] Only let some people pass door

Nevalopo

Demigod
Joined
Jul 21, 2008
Messages
5,165
Reaction score
68
Location
Sweden, Landskrona
Hi! Im looking for a door that lets everyone pass except the ones with name : Druid - Paladin - Sorcerer - Knight
Thoose names can NOT pass the door.. Rest can past ^^ Is this possible?
 
if getPlayerName(cid) == Druid or getPlayerName == Paladin or getPlayerName == Sorcerer or getPlayerName == Knight then
return false
end

add that in the script.
 
Plx explain a bit more

Please.. A little more explanation? I make a script called doorpass.lua right? then i paste that code in there? after that i do what?... Or i put an acitonid to the door? Cuz its just 1 door.. not all doors
 
Last edited:
Make a script, paste it there and add it in actions.xml and your map editor.

Code:
funciton onUse(cid, item)
    local names = { "Druid", "Paladin", "Knight", "ImGay" }
    if isInArray(names, getCreatureName(cid)) == TRUE then
        -- do something
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
    return FALSE
    end
    return TRUE
end
 
help :p

in acitons.xml: I add what?
<action uniqueid="12345" script="other/doorname.lua"/>
<action fromid="12345" toid="12346" script="other/doorname.lua"/>
<action itemid="12345" script="other/doorname.lua"/>

Sorry im a bit new to this xD
 
<action actionid="youchoose" script="other/doorname.lua"/>

and the same actionid as "youchoose", you have to assign to those doors by mapeditor.
 
Hmmm

It didnt work :/ Im getting this error:
[02/11/2008 21:25:18] Warning: [Event::loadScript] Can not load script. data/actions/scripts/other/doorname.lua
[02/11/2008 21:25:18] data/actions/scripts/other/doorname.lua:1: '=' expected near 'onUse'
 
Misspelled 'function' :w00t:

Code:
function onUse(cid, item)
	local names = { "Druid", "Paladin", "Knight", "Sorcerer" }
	if isInArray(names, getCreatureName(cid)) == TRUE then
		--Open doors
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
	return FALSE
	end
	return TRUE
end
 
Hmm...

Im getting no errors now but.... I put an "Gate of Experience" on the map editor and first i tryed to change the actionid to 1337 then it says only the worthy may pass and u need 377 to pass.. after that i tryed to set the actionid to 991 and then it works but Druid, Knight, Sorc, Pally can pass... I mean.. it doesnt "LOCK" the door but it shows up text "It is locked." but still it opens..
 
Code:
 local nPos = {
x = 000,
y = 000,
z = 000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if ((getCreatureName(cid) == Druid) and (getCreatureName(cid) == Paladin) and (getCreatureName(cid) == Knight) and (getCreatureName(cid) == Sorcerer) and (getPlayerLevel(cid) >= 300)) then
	   doTeleportThing(cid, nPos, TRUE)
    else
	   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can\'t pass.")
 end
 return TRUE
end
 
Bomba

Hmm.. What do i put in actions.xml? And thoose posistions is where the door is at right?
Or when u click the door this Npos is where it will teleport you? can it be a normal gate of experience?
 
Last edited:
PHP:
funciton onUse(cid, item)
    local names = { "Druid", "Paladin", "Knight", "Sorcerer" }
    if isInArray(names, getCreatureName(cid)) == TRUE then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
        return FALSE
    end
    return TRUE
end

If it doesn't say anything AND doesn't open up, change FALSE to TRUE and TRUE to FALSE
 
Error...

It doesnt open... It says its locked. I tryed changing the true to false so it looked like this:

function onUse(cid, item)
local names = { "Druid", "Paladin", "Knight", "Sorcerer" }
if isInArray(names, getCreatureName(cid)) == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
return TRUE
end
return FALSE
end

But still.. It wont work
 
Last edited:
You can't use door of experience, you need to use a normal "locked" door

You can use "Gates of Expertise". Marcinek just forgot that the player has to be moved away from the door if the name of the player does contain the name of the names which are not able to pass.

this should work just change the coordinates for the exit...

Code:
funciton onUse(cid, item)
local names = {"Druid", "Paladin", "Knight", "Sorcerer"}
local exit = {x=, y=, z=}
    if isInArray(names, getCreatureName(cid)) == TRUE then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
        doTeleportThing(cid, exit)
    end
    return TRUE
end
 
Last edited:
Error

[03/11/2008 17:18:50] Warning: [Event::loadScript] Can not load script. data/actions/scripts/other/doorn1.lua
[03/11/2008 17:18:50] data/actions/scripts/other/doorn1.lua:3: unexpected symbol near '{'

This error i get from this code:

function onUse(cid, item)
local names = {"Druid", "Paladin", "Knight", "Sorcerer"}
local exit {x=1095, y=1218, z=6}
if isInArray(names, getCreatureName(cid)) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
doTeleportThing(cid, exit)
end
return TRUE
end
 
Back
Top