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

Teleport scroll

Moj mistrz

Monster Creator
Joined
Feb 1, 2008
Messages
932
Solutions
10
Reaction score
295
Location
Poland
Hi, can someone repair my script? I want in this script to make teleports when im a druid lvl 50 or higher and im hm.. on demons and i want back to temple. Then i use scroll and make two portals, one 2 sqm from me, this tp can teleport me to temple and disapear after 30 seconds, and second in temple 2 sqm from me too, this tp teleport me to demons again and disapear by 120 seconds. I can't use this scroll when im in fight with someone, or have skull. Now ill can give you my sucks script (i know im noob in scripting). The positions in script are just for testing.
THANKS ANYWAY.

function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = { x=2395, y=1904, z=7 }
local skull = getCreatureSkullType(cid)
local tpTime = 30
local tpTime2 = 120
local position = getCreaturePosition
local pos2 = { x=2395, y=1907, z=7 }

if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if((not(isDruid(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 50) and getPlayerCustomFlagValue(itemEx.uid,

PlayerCustomFlag_GamemasterPrivileges) == FALSE) then
doCreatureSay(itemEx.uid, "Only druids of level 50 or above use this portal scroll.", TALKTYPE_ORANGE_1)
if (getCreatureCondition(cid, CONDITION_INFIGHT) == false) then
if (skull == SKULL_NONE) then
end
position.x = position.x + 2 or getClosestFreeTile(cid, false, false)
pos2.x = pos2.x + 2 or getClosestFreeTile(cid, false, false)

doCreateTeleport(1387, pos, position)
doCreateTeleport(1387, pos, pos2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. tpTime .." seconds until the portal

will disapear.")
doPlayerSay(cid, "You have ".. tpTime .." seconds until the portal will disapear.",

TALKTYPE_ORANGE_1)
addEvent(doRemoveItem, tpTime * 1000, getTileItemById(position, 1387).uid, 1)
addEvent(doRemoveItem, tpTime2 * 1000, getTileItemById(pos2, 1387).uid, 1)
doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are skulled and cannot use this.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are currently in a fight.")
end
return true
end

THANKS ANYWAY. :)
 
Back
Top