Forum Nie Tylko Do Tibii I OTS!!
SKRYPT:
Wchodzimy w folder actions i tworzymy plik prezenty.lua
I wklejamy ten kod:
======================================================================
Code:
-- Skrypt by Arkadiusz --
function onUse(cid, item, fromPosition, itemEx, toPosition)
local config = {poziom3 = 800000 , poziom2 = 500000 , poziom1 = 100000 , poziom = 10 , item3 = 2144 , item2 = 2143 , item1 = 2142 , item = 2141 , ilosc3 = 1 , ilosc2 = 1 , ilosc1 = 1 , ilosc = 1 , storage = 2892}
if getPlayerStorageValue(cid, config.storage) == 4 then
doPlayerSendTextMessage(cid,22,"Wzieles juz wszystkie prezenty")
else
if getPlayerLevel(cid) >= config.poziom3 and getPlayerStorageValue(cid, config.storage) == 3 then
doPlayerAddItem(cid, config.item3, config.ilosc3)
doPlayerSendTextMessage(cid,22,"Otrzymujesz prezent na " .. config.poziom3 .. " lvlu")
setPlayerStorageValue(cid,config.storage, 4)
else
if getPlayerLevel(cid) >= config.poziom2 and getPlayerStorageValue(cid, config.storage) == 2 then
doPlayerAddItem(cid, config.item2, config.ilosc2)
doPlayerSendTextMessage(cid,22,"Otrzymujesz prezent na " .. config.poziom2 .. " lvlu nastepny prezent na " .. config.poziom3 .. " lvlu ")
setPlayerStorageValue(cid,config.storage, 3)
else
if getPlayerLevel(cid) >= config.poziom1 and getPlayerStorageValue(cid, config.storage) == 1 then
doPlayerAddItem(cid, config.item1, config.ilosc1)
doPlayerSendTextMessage(cid,22,"Otrzymujesz prezent na " .. config.poziom1 .. " lvlu nastepny prezent na " .. config.poziom2 .. " lvlu")
setPlayerStorageValue(cid,config.storage, 2)
else
if getPlayerLevel(cid) >= config.poziom and getPlayerStorageValue(cid, config.storage) == -1 then
doPlayerAddItem(cid, config.item, config.ilosc)
doPlayerSendTextMessage(cid,22,"Otrzymujesz prezent na " .. config.poziom .. " lvlu nastepny prezent na " .. config.poziom1 .." lvlu")
setPlayerStorageValue(cid,config.storage, 1)
else
doPlayerSendTextMessage(cid,22,"Wbij wiekszy lvl i wez prezent")
end
end
end
end
end
return 1
end
------------------------------------------------------------------------------------------------------------------------------
Teraz wklejamy ta linijke do actions.xml
Code:
<action itemid="2105" script="prezenty.lua" />
======================================================================
KONFIGURACJA:
Tam gdzie kolor czerwony wpisujemy jaki lvl bedzie potrzebny jako 1 do wziecia prezentu.
Tam gdzie kolor niebieski wpisujemy jakie id itemu bedzie naszym 1 prezentem
Tam gdzie kolor różowy wpisujemy ile itemow mamy otrzymac jako 1 prezent czyli np jak prezent bedzie cc to tutaj wpisujemy ile ich ma byc.
Tam gdzie kolor zielony wpisujemy id na jakim itemie ma dzialac ten skrypt (podstawowo wpisane jest id choinki)
Z poziom1, poziom2, poziom3 robimy tak samo jak wyzej czyli jak np poziom1 to ustawiamy kolejny poziom jaki ma byc potrzebny do wziecia preznetu
Z item1, item2, item3 robimy tak samo jak wyzej czyli jak np item1 to ustawiamy kolejny item jaki dostaniemy jako prezent po wbiciu nastepnego lvlu czyli poziom1
Z ilosc1, ilosc2, ilosc3 robimy tak samo jak wyzej na rozowo jest podkreslone
I to koniec. Skrypt wykonany w 100% by Arkadiusz i sprawdzony. Prosze komentowac jesli ktos czegos nie rozumie to pisac na gg: 4322405 chetnie pomoge skonfigurowac.
SKRYPT BYŁ TESTOWANY I DZIAŁA POPRAWNIE
Offline