panczo 1995
Advanced User
- Joined
- Apr 5, 2009
- Messages
- 383
- Reaction score
- 13
potrzebuje skryptu ktory po nacisnieciu na drzwi przeteleportuje nas do training roomu i przy tym jeszcze wyskoczy jakis napis za pomoc rep
function onUse(cid, item, fromPosition, itemEx, toPosition)
local position = {x = 1000, y = 1000, z = 7} --- pozycja gdzie ma teleportowac
local napis = "Welcome in Training Room!" --- napis jaki ma sie wyswietlac
doTeleportThing(cid, position, TRUE)
doCreatureSay(cid, napis, TALKTYPE_ORANGE_1)
return TRUE
end
<action actionid="9993" script="drzwi.lua"/>
function onUse(cid, item, fromPosition, itemEx, toPosition)
local napis = "Welcome in Training Room!" --- napis jaki ma sie wyswietlac
local poz = getCreaturePosition(cid)
if (poz.y-1 == toPosition.y) then
pozycja = {x=toPosition.x, y=toPosition.y-1, z=toPosition.z}
elseif (poz.y+1 == toPosition.y) then
pozycja = {x=toPosition.x, y=toPosition.y+1, z=toPosition.z}
elseif (poz.x+1 == toPosition.x) then
pozycja = {x=toPosition.x+1, y=toPosition.y, z=toPosition.z}
elseif (poz.x-1 == toPosition.x) then
pozycja = {x=toPosition.x-1, y=toPosition.y, z=toPosition.z}
end
doTeleportThing(cid, pozycja, TRUE)
doSendMagicEffect(pozycja, 10)
doCreatureSay(cid, napis, TALKTYPE_ORANGE_1)
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local napis_wejscie = "Welcome in Training Room!" --- napis jaki ma sie wyswietlac przy wejsciu
local napis_wyjscie = "Good training!" --- napis jaki ma sie wyswietlac przy wyjsciu
local exit = {x=1000, y=1000, z=7} --- gdzie ma nas teleportowac po wyjsciu
if (getTilePzInfo(fromPosition) == true) then
local poz = getCreaturePosition(cid)
if (poz.y-1 == toPosition.y) then
pozycja = {x=toPosition.x, y=toPosition.y-1, z=toPosition.z}
elseif (poz.y+1 == toPosition.y) then
pozycja = {x=toPosition.x, y=toPosition.y+1, z=toPosition.z}
elseif (poz.x+1 == toPosition.x) then
pozycja = {x=toPosition.x+1, y=toPosition.y, z=toPosition.z}
elseif (poz.x-1 == toPosition.x) then
pozycja = {x=toPosition.x-1, y=toPosition.y, z=toPosition.z}
end
doTeleportThing(cid, pozycja, true)
doSendMagicEffect(pozycja, 10)
doCreatureSay(cid, napis_wejscie, TALKTYPE_ORANGE_1)
else
doTeleportThing(cid, exit, true)
doSendMagicEffect(pozycja, 10)
doCreatureSay(cid, napis_wyjscie, TALKTYPE_ORANGE_1)
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local napis_wejscie = "Welcome in Training Room!" --- napis jaki ma sie wyswietlac przy wejsciu
local napis_wyjscie = "Good training!" --- napis jaki ma sie wyswietlac przy wyjsciu
local exit = {x=1000, y=1000, z=7} --- gdzie ma nas teleportowac po wyjsciu
if (getTilePzInfo(fromPosition) == true) then
local poz = getCreaturePosition(cid)
if (poz.y-1 == toPosition.y) then
pozycja = {x=toPosition.x, y=toPosition.y-1, z=toPosition.z}
elseif (poz.y+1 == toPosition.y) then
pozycja = {x=toPosition.x, y=toPosition.y+1, z=toPosition.z}
elseif (poz.x+1 == toPosition.x) then
pozycja = {x=toPosition.x+1, y=toPosition.y, z=toPosition.z}
elseif (poz.x-1 == toPosition.x) then
pozycja = {x=toPosition.x-1, y=toPosition.y, z=toPosition.z}
end
doTeleportThing(cid, pozycja, true)
doSendMagicEffect(pozycja, 10)
doCreatureSay(cid, napis_wejscie, TALKTYPE_ORANGE_1)
return true
elseif (getTilePzInfo(fromPosition) == false) then
doTeleportThing(cid, exit, true)
doSendMagicEffect(pozycja, 10)
doCreatureSay(cid, napis_wyjscie, TALKTYPE_ORANGE_1)
end
return true
end