Tworzymy plik o nazwie starlight.lua w data/actions/scripts i wklejamy:
Kod PHP:
function onUse(cid, item, frompos, itemEx, topos)
if(not isPlayer(itemEx.uid) or (cid ~= itemEx.uid)) then
if(topos.x == CONTAINER_POSITION) then
topos = getThingPos(item.uid)
end
return true
end
local range = math.random(4,7)
local kolory = {0,5,18,35,66,78,89,112,120,129,144,152,154,156,180,190,192,205,210,215,255}
for i=1, #kolory do
doSetCreatureLight(cid, range, math.random(kolory[1],kolory[i]), 60*1000)
doSendMagicEffect(topos, CONST_ME_TELEPORT)
end
return true
end
Kod PHP:
<action itemid="2361" event="script" value="starlight.lua" />
Zakładki