Gosu - 2008-08-23 00:47:41

hehe znalazlem ciekawy skrypt wiec sie nim podziele. Skrypt na elektryczne krzeslo na karanie :D No to jedziemy ;]

1. W data/actions/scripts tworzymy plik o nazwie "krzeslo.lua"
2. Otwieramy notatnikiem
3. Wklejamy takie cos:

Kod:

function onUse(cid, item, frompos, item2, topos)

    if item.uid == 7666 and item.itemid == 1945 then
        player1pos = {x=xxx, y=xxx, z=x, stackpos=253}
        player1 = getThingfromPos(player1pos)

        if player1.itemid > 0 then
            player1heal = getPlayerHealth(player1.uid)
            player1mana = getPlayerMana(player1.uid)
            smierc = (player1mana) + (player1heal)

            doPlayerAddHealth(player1.uid,-smierc)
            doSendMagicEffect(player1pos,11)

            doTransformItem(item.uid,item.itemid+1)
        else
            doPlayerSendCancel(cid,"Lack convicted :(")

        end


elseif item.uid == 7666 and item.itemid == 1946 then
        player1pos = {x=xxx, y=xxx, z=xxx, stackpos=253}
        player1 = getThingfromPos(player1pos)

        if player1.itemid > 0 then
            player1heal = getPlayerHealth(player1.uid)
            player1mana = getPlayerMana(player1.uid)
            smierc = (player1mana) + (player1heal)

            doPlayerAddHealth(player1.uid,-smierc)
            doSendMagicEffect(player1pos,11)

            doTransformItem(item.uid,item.itemid-1)
        else
            doPlayerSendCancel(cid,"Lack convicted :(")

        end

    else
        return 0
       end

    return 1

end

4. w data/actions/actions.xml dodajemy na gorze linijke:

Kod:

<action uniqueid="7666" script="krzeslo.lua" />

5. Zapisujemy
6. W grze twoezymy krzeslo o id 7666 i cieszymy sie itemkiem :)

www.dragonballzgra.pun.pl www.yourninjaway.pun.pl www.grafamargo.pun.pl www.desinemt2.pun.pl www.narutogamer.pun.pl