Call Me Taffy
Call Me Maybe
- Joined
- Aug 9, 2009
- Messages
- 651
- Reaction score
- 123
Umm well I just perfected my Voc-Based Door scripts thanks to some (unknowingly) help by Cybermaster. I'm 100% sure there's a easier way to do this, but here it is for those who want it.
Tested, and works perfectly on 0.3.5+.
In actions.xml you place the UID (of door) and name of script:
And in the door1.lua file you place:
local newPos = Area you'll be after using the door.
item.itemid = The ID of the door (In my case, the marble door facing east/west.
item.uid = the UID I used on that marble door in RME or SimOne's.
if vocation = Set to w/e vocation you want to be able to use the door.
doSendMagicEffect = Sends random effect on the person after using the door, 1-67 = alot, and you can check em all out.
else = Sends message "Wrong vocation..." if it's the wrong vocation.
Pretty simple eh xD
Tested, and works perfectly on 0.3.5+.
In actions.xml you place the UID (of door) and name of script:
Code:
<action uniqueid="19001" event="script" value="door1.lua"/>
And in the door1.lua file you place:
Code:
local newPos = {x=995, y=1000, z=9}
function onUse(cid, item, frompos, item2, topos)
local vocation = getPlayerVocation(cid)
if item.itemid == 1259 and item.uid == 19001 then
if vocation == 1 then
doTeleportThing(cid, newPos)
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
else
doPlayerSendCancel(cid, "Wrong vocation...")
end
end
return TRUE
end
local newPos = Area you'll be after using the door.
item.itemid = The ID of the door (In my case, the marble door facing east/west.
item.uid = the UID I used on that marble door in RME or SimOne's.
if vocation = Set to w/e vocation you want to be able to use the door.
doSendMagicEffect = Sends random effect on the person after using the door, 1-67 = alot, and you can check em all out.
else = Sends message "Wrong vocation..." if it's the wrong vocation.
Pretty simple eh xD