Werewolf
Forbidden Ascension
- Joined
- Jul 15, 2012
- Messages
- 886
- Reaction score
- 123
LUA:
local t = {
storage = 12345,
time = 3,
vocations = {8, 16, 46, 47, 48, 58}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(t.vocations and not isInArray(t.vocations, getPlayerVocation(cid) or isInArray({CONST_PROP_MOVABLE, CONST_PROP_BLOCKSOLID}, hasItemProperty(getTileThingByPos(toPosition).uid)))) then
doPlayerSendCancel(cid, "Sorry, not possible.")
elseif(getTilePzInfo(getCreaturePosition(cid)) == TRUE or getTilePzInfo(toPosition) == TRUE) then
doPlayerSendCancel(cid, "You cannot Teleport in a protection zone.")
elseif(getPlayerStorageValue(cid, t.storage) > os.time()) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, t.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, t.storage) - os.time()) == 1 and "" or "s") .. " to teleport.")
else
doSendDistanceShoot(getCreaturePosition(cid), toPosition, CONST_ANI_HOLY) -- Holy effect can be changed here.
doTeleportThing(cid, toPosition)
doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA)
setPlayerStorageValue(cid, t.storage, os.time() + t.time)
end
return true
end
------------------------------------------------------------------------------------------------This Rune Works Perfect, However it has 1 flaw... It is able to teleport inside walls and players. I need this rune to stop teleporting in non-movable areas like, Trees, Players, Walls and stuff like that, Is anyone able to help me out D:?
Last edited by a moderator: