Lua (TFS 0.4) Rook system in .lua

marek12

Available for sprite works
Joined
Apr 8, 2020
Messages
385
Solutions
4
Reaction score
344
Hi guys.
I am learning lua recently and I noticed I have no rook system in my TFS, so I decided that I will try to make it myself in lua in creaturescripts.
Here is the script. If you see something that is not right, I will be more than happy to know that as I will learn more :D


Lua:
function onPrepareDeath(cid, deathList)
    if getPlayerExperience(cid) < 1500 and getPlayerVocation(cid) > 0 then

            doPlayerSetTown(cid, 19)
        doPlayerAddExperience(cid, -getPlayerExperience(cid))
        doPlayerSetVocation(cid, 0)

        for i = 1, 10 do
            local slotItem = getPlayerSlotItem(cid, i)
            if slotItem.itemid > 0 then
                doRemoveItem(slotItem.uid)

    end
        end
            end
   return true
end
Post automatically merged:

also can someone add to it skills reseting?
 
Top