Forum poświęcone powstawaniu Belxena OTS
Oto skrypt na tworzenie sie teleportu w pewnym miejscu gdy stajemy na wybrana kratke I na jego zniknie gdy z owej kratki zejdziemy. Cos podobnego jest na real tibi w quescie na dark shield. 100 % by me.
Testowalem skrypt na 8.4 sql The Forgotten Server - Version 0.2 (Mystic Spirit).
Wchodzimy w data/movements/scripts I tworzymy plik o nazwie tp nastepnie wpisujemy
KOD PHP:
Cytat:
----- create tp by tequ95
function onStepIn(cid, item, pos)
if item.actionid == 9792 then
local pos = getPlayerPosition(cid)
local itemid = 1387
local topos = {x=406, y=409, z=7, }
local createpos = {x=397, y=406, z=7, }
doCreateTeleport(itemid, topos, createpos)
end
return 1
end
--------------------------------------------------------------
function onStepOut(cid, item, pos)
if item.actionid == 9792 then
local pos = getPlayerPosition(cid)
local itemid = 1387
local createpos = {x=397, y=406, z=7, }
gettp = getThingfromPos(createpos)
doRemoveItem(gettp.uid,1)
end
return 1
end
Teraz wchodzimy w data/movements/movements.xml i dodajemy linijki:
Cytat:
<movevent event="StepIn" actionid="9792" script="tp.lua" />
<movevent event="StepOut" actionid="9792" script="tp.lua" />
Następnie w map edytorze ustawcie na wybrana kratke actionid 9792
i gotowe.
1387 ----- id teleporta
{x=406, y=409, z=7, } ------- gdzie zabiera teleport gdy do niego wejdziesz
{x=397, y=406, z=7, } ---- pozycja usuniecia i storzenia teleportu
9792 ---- action id kratki
Offline