Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, fromPos, item2, toPos)
- local vocs = { -- [actionid] = {vocs = {vocation_ids}, level = level_needed}
- [1212] = {voc = {1, 5}, level = 10},
- [1213] = {voc = {2, 6}, level = 10},
- [1214] = {voc = {3, 7}, level = 10},
- [1215] = {voc = {4, 8}, level = 10},
- }
- local door = vocs[item.actionid]
- if not isInArray(door.voc, getPlayerVocation(cid)) then
- doPlayerSendCancel(cid, "You cannot pass.") return true
- elseif getPlayerLevel(cid) < door.level then
- doPlayerSendCancel(cid, "Not enough level.") return true
- end
- doTransformItem(item.uid, item.itemid+1)
- doTeleportThing(cid, toPos)
- addEvent(doTransformItem, 1000, item.uid, item.itemid-1)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement