• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Allmost finished] 95% Need help with single end tag

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
7,030
Solutions
256
Reaction score
2,118
Location
Norway
GitHub
Znote
It is 100% finish, 100% bugfree and released!

Enter HERE to see it! Thanks to everybody on this thread for helping me!
 
Last edited:
You do need to put an 'end' after each 'if'. So you're missing a shitload of 'end's

Code:
--- ------------------------------- ---
--- Inspired by stix360's npc trade ---
--- item for item example. Not sure ---
--- if he made it, but I found it - ---
--- through his posts. ------------ ---
--- ------------------------------- ---
--- The shit job was done by me --- ---
--- ----- The hoster of Znote ----- ---
--- ------------------------------- --- 
local talk_state = 0

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)     npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg)     end
function onThink()  npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)


    if msgcontains(msg, 'spike sword') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2383,1) >= 1 then --- spike sword
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2383,1) == 1 then --- spike sword
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7763) --- Spike sword with ice enchant
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'barbarian axe') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2429,1) >= 1 then --- barbarian axe
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2429,1) == 1 then --- barbarian axe
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7768) --- barbarian axe with ice enchant
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'relic sword') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7383,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7383,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7764) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'blacksteel sword') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7406,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7406,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7766) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'dragon slayer') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7402,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7402,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7767) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'mystic blade') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7384,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7384,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7765) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'knight axe') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2430,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2430,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7769) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'heroic axe') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7389,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7389,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7770) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'headchopper') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7380,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7380,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7771) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'war axe') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2454,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2454,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7772) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'clerical mace') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2423,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2423,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7773) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'crystal mace') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2445,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2445,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7774) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'cranial basher') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7415,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7415,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7775) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'orcish maul') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7392,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7392,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7776) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'war hammer') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2391,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2391,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7777) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'arrow') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2544,100) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2544,100) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,2544,100) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end

    if msgcontains(msg, 'no') then
        selfSay('Maybe another time then.')
        talk_state = 0
    end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

This one should work, try it.
 
Last edited:
Could you give me a short example?

Do i need to add an exstra end every if tag in the text, or just count the if and add lots of ends in the bottom? :p I have no special experience in lua else than looking at scripts on ****** and otland.

Code:
end
end
end
end
end
end
end
end
Do i need to make lots of ends like this?
 
ohh nice! im trying the script now, are you using some sort of program to fix the problem? :eek:

Can i post the fire, nature, energy script here to so u can fix it? or shall i send pm to you? i'll release it, giving some creds to u etc once its done, or u can release it :p
 
No, I don't use any special program, the only program I'm using is Notepad++, which highlights the code, nothing else. And sure, post the other scripts and I'll fix them for ya. Either post or PM, I don't care. :)

Good to see that you at least tried! :D Love people that tries before asking. :)
 
end espected to (to close if at line 336) near else~

script didn't seem to work [sry for double post]
 
Ah, sorry, fixed now ^^
Code:
--- ------------------------------- ---
--- Inspired by stix360's npc trade ---
--- item for item example. Not sure ---
--- if he made it, but I found it - ---
--- through his posts. ------------ ---
--- ------------------------------- ---
--- The shit job was done by me --- ---
--- ----- The hoster of Znote ----- ---
--- ------------------------------- --- 
local talk_state = 0

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)     npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg)     end
function onThink()  npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)


    if msgcontains(msg, 'spike sword') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2383,1) >= 1 then --- spike sword
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2383,1) == 1 then --- spike sword
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7763) --- Spike sword with ice enchant
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'barbarian axe') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2429,1) >= 1 then --- barbarian axe
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2429,1) == 1 then --- barbarian axe
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7768) --- barbarian axe with ice enchant
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'relic sword') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7383,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7383,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7764) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'blacksteel sword') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7406,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7406,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7766) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'dragon slayer') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7402,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7402,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7767) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'mystic blade') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7384,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7384,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7765) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'knight axe') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2430,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2430,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7769) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'heroic axe') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7389,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7389,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7770) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'headchopper') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7380,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7380,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7771) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'war axe') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2454,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2454,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7772) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'clerical mace') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2423,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2423,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7773) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'crystal mace') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2445,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2445,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7774) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'cranial basher') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7415,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7415,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7775) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'orcish maul') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7392,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7392,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7776) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'war hammer') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2391,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2391,1) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7777) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'arrow') then
        if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,2544,100) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == 1 then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2544,100) == 1 then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,2544,100) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end

    if msgcontains(msg, 'no') then
        selfSay('Maybe another time then.')
        talk_state = 0
    end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Works now! But it looks like i did another misstake

I get a wrong message, luagetplayeritemcount() player not found

trying to enchant the spike sword, i guess i did wrong with the ice shards, since i made it look after 5 shards, but it dosn't stack? or?

Edit:

For the beginning lua i'm advicing them to juse Notepad++ u can see the lines and how many ends u need to put

Where can I download Notepad++? Is it something special, or is it the normal notepad? :p
 
Last edited:
any suggestions? I guess I tryed to make this script a little to early for my experience :p But its still a chance to fix this script isn't it? Atleast i though i had mostly of the correct functions here :/

Edit:

 
Last edited:
Let's make another try then. I found some errors that I didn't notice last time.

Code:
--- ------------------------------- ---
--- Inspired by stix360's npc trade ---
--- item for item example. Not sure ---
--- if he made it, but I found it - ---
--- through his posts. ------------ ---
--- ------------------------------- ---
--- The shit job was done by me --- ---
--- ----- The hoster of Znote ----- ---
--- ------------------------------- --- 
local talk_state = 0

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)     npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg)     end
function onThink()  npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)

        player_gold = getPlayerItemCount(cid,2148)
        player_plat = getPlayerItemCount(cid,2152)*100
        player_crys = getPlayerItemCount(cid,2160)*10000
        player_money = player_gold + player_plat + player_crys

    if msgcontains(msg, 'spike sword') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,2383) >= 1 then --- spike sword
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2383,1) == TRUE then --- spike sword
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7763) --- Spike sword with ice enchant
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'barbarian axe') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,2429) >= 1 then --- barbarian axe
                    if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                        if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                            if doPlayerRemoveItem(cid,2429,1) == TRUE then --- barbarian axe
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7768) --- barbarian axe with ice enchant
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'relic sword') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,7383) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7383,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7764) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'blacksteel sword') then
        if getPlayerItemMoney(cid,600) >= 1 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290,5) >= 1 then --- 5 ice shards
                if getPlayerItemCount(cid,7406,1) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7406,1) == TRUE then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7766) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'dragon slayer') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,7402) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7402,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7767) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'mystic blade') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,7384) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7384,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7765) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'knight axe') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,2430) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2430,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7769) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'heroic axe') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,7389) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7389,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7770) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'headchopper') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,7380) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7380,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7771) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'war axe') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,2454) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2454,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7772) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'clerical mace') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,2423) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2423,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7773) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'crystal mace') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,2445) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2445,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7774) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'cranial basher') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,7415) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7415,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7775) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'orcish maul') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,7392) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,7392,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7776) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'war hammer') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,2391) >= 1 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2391,1) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,7777) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end
    if msgcontains(msg, 'arrow') then
        if player_money >= 600 then --- 60 platinum coins
            if getPlayerItemCount(cid,7290) >= 5 then --- 5 ice shards
                if getPlayerItemCount(cid,2544) >= 100 then --- weapon
                    if doPlayerRemoveMoney(cid,600) == TRUE then --- 60 platinum coins
                        if doPlayerRemoveItem(cid,7290,5) == TRUE then --- 5 ice shards
                            if doPlayerRemoveItem(cid,2544,100) == TRUE then --- weapon
                                selfSay('Enchantmenth completed, heres your weapon.')
                                doPlayerAddItem(cid,2544,100) --- ice enchanted weapon
                            else
                                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                                talk_state = 0
                            end
                        else
                            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                            talk_state = 0
                        end
                    else
                        selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                        talk_state = 0
                    end
                else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
                  end
            else
                selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                talk_state = 0
            end
        else
            selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
            talk_state = 0
        end
    end

    if msgcontains(msg, 'no') then
        selfSay('Maybe another time then.')
        talk_state = 0
    end
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
OMG IT WORKED!!!!!!! :D

Empty = making newbies dream come true =D

Kk heres the other scripts (a)


Fire enchanter
Code:
--- ------------------------------- ---
--- Inspired by stix360's npc trade ---
--- item for item example. Not sure ---
--- if he made it, but I found it - ---
--- through his posts. ------------ ---
--- ------------------------------- ---
--- The shit job was done by me --- ---
--- ----- The hoster of Znote ----- ---
--- ------------------------------- --- 
local talk_state = 0

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) 	npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) 	npcHandler:onCreatureSay(cid, type, msg) 	end
function onThink()  npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)


     if msgcontains(msg, 'spike sword') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,2383,1) >= 1 then --- spike sword
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,2383,1) == 1 then --- spike sword
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7744) --- Spike sword with fire enchant
                    end
              else
     if msgcontains(msg, 'barbarian axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,2429,1) >= 1 then --- barbarian axe
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,2429,1) == 1 then --- barbarian axe
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7749) --- barbarian axe with fire enchant
                    end
              else
     if msgcontains(msg, 'relic sword') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,7383,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,7383,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7745) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'blacksteel sword') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,7406,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,7406,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7747) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'dragon slayer') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,7402,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,7402,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7748) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'mystic blade') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,7384,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,7384,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7746) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'knight axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,2430,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,2430,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7750) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'heroic axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,7389,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,7389,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7751) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'headchopper') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,7380,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,7380,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7752) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'war axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,2454,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,2454,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7753) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'clerical mace') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,2423,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,2423,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7754) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'crystal mace') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,2445,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,2445,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7755) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'cranial basher') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,7415,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,7415,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7756) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'orcish maul') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,7392,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,7392,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7757) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'war hammer') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,2391,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,2391,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7758) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'arrow') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2795,5) >= 1 then --- 5 fire mushrooms
              if getPlayerItemCount(cid,2544,100) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2795,5) == 1 then --- 5 fire mushrooms
                    if doPlayerRemoveItem(cid,2544,100) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7840,100) --- fire enchanted weapon
                    end
              else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
              end
     elseif msgcontains(msg, 'no') then
              selfSay('Maybe another time then.')
              talk_state = 0
     end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Nature enchanter
Code:
--- ------------------------------- ---
--- Inspired by stix360's npc trade ---
--- item for item example. Not sure ---
--- if he made it, but I found it - ---
--- through his posts. ------------ ---
--- ------------------------------- ---
--- The shit job was done by me --- ---
--- ----- The hoster of Znote ----- ---
--- ------------------------------- --- 
local talk_state = 0

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) 	npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) 	npcHandler:onCreatureSay(cid, type, msg) 	end
function onThink()  npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)


     if msgcontains(msg, 'spike sword') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,2383,1) >= 1 then --- spike sword
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,2383,1) == 1 then --- spike sword
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7854) --- Spike sword with fire enchant
                    end
              else
     if msgcontains(msg, 'barbarian axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,2429,1) >= 1 then --- barbarian axe
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,2429,1) == 1 then --- barbarian axe
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7859) --- barbarian axe with fire enchant
                    end
              else
     if msgcontains(msg, 'relic sword') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,7383,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,7383,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7855) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'blacksteel sword') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,7406,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,7406,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7857) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'dragon slayer') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,7402,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,7402,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7858) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'mystic blade') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,7384,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,7384,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7856) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'knight axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,2430,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,2430,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7860) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'heroic axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,7389,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,7389,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7861) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'headchopper') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,7380,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,7380,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7862) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'war axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,2454,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,2454,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7863) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'clerical mace') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,2423,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,2423,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7864) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'crystal mace') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,2445,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,2445,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7865) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'cranial basher') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,7415,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,7415,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7866) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'orcish maul') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,7392,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,7392,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7867) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'war hammer') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,2391,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,2391,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7868) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'arrow') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,4850,1) >= 1 then --- 1 hydra egg
              if getPlayerItemCount(cid,2544,100) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,4850,1) == 1 then --- 1 hydra egg
                    if doPlayerRemoveItem(cid,2544,100) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7850,100) --- fire enchanted weapon
                    end
              else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
              end
     elseif msgcontains(msg, 'no') then
              selfSay('Maybe another time then.')
              talk_state = 0
     end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Energy enchanter
Code:
--- ------------------------------- ---
--- Inspired by stix360's npc trade ---
--- item for item example. Not sure ---
--- if he made it, but I found it - ---
--- through his posts. ------------ ---
--- ------------------------------- ---
--- The shit job was done by me --- ---
--- ----- The hoster of Znote ----- ---
--- ------------------------------- --- 
local talk_state = 0

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) 	npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) 	npcHandler:onCreatureSay(cid, type, msg) 	end
function onThink()  npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)


     if msgcontains(msg, 'spike sword') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,2383,1) >= 1 then --- spike sword
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,2383,1) == 1 then --- spike sword
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7869) --- Spike sword with fire enchant
                    end
              else
     if msgcontains(msg, 'barbarian axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,2429,1) >= 1 then --- barbarian axe
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,2429,1) == 1 then --- barbarian axe
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7874) --- barbarian axe with fire enchant
                    end
              else
     if msgcontains(msg, 'relic sword') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,7383,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,7383,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7870) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'blacksteel sword') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,7406,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,7406,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7872) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'dragon slayer') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,7402,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,7402,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7873) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'mystic blade') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,7384,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,7384,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7871) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'knight axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,2430,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,2430,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7875) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'heroic axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,7389,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,7389,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7876) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'headchopper') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,7380,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,7380,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7877) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'war axe') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,2454,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,2454,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7878) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'clerical mace') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,2423,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,2423,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7879) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'crystal mace') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,2445,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,2445,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7880) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'cranial basher') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,7415,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,7415,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7881) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'orcish maul') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,7392,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,7392,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7882) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'war hammer') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,2391,1) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,2391,1) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7883) --- fire enchanted weapon
                    end
              else
     if msgcontains(msg, 'arrow') then
              if getPlayerItemCount(cid,2152,60) >= 1 then --- 60 platinum coins
              if getPlayerItemCount(cid,2124,1) >= 1 then --- 1 chrystal ring
              if getPlayerItemCount(cid,2544,100) >= 1 then --- weapon
                    if doPlayerRemoveItem(cid,2152,60) == 1 then --- 60 platinum coins
                    if doPlayerRemoveItem(cid,2124,1) == 1 then --- 1 chrystal ring
                    if doPlayerRemoveItem(cid,2544,100) == 1 then --- weapon
                              selfSay('Enchantmenth completed, heres your weapon.')
                              doPlayerAddItem(cid,7838,100) --- fire enchanted weapon
                    end
              else
                    selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
                    talk_state = 0
              end
     elseif msgcontains(msg, 'no') then
              selfSay('Maybe another time then.')
              talk_state = 0
     end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Describtion note says its all fire enchants, but it isnt :p
 
Last edited:
Okay, anyway thanks in advance! :D

could you pm me the results then? :)
 
Try this lol... But re-add the items (test before you do that):
PHP:
--/*- ------------------------------- ---
--- Inspired by stix360's npc trade ---
--- item for item example. Not sure ---
--- if he made it, but I found it - ---
--- through his posts. ------------ ---
--- ------------------------------- ---
--- The shit job was done by me --- ---
--- ----- The hoster of Znote ----- ---
--- ------------------------------- -*/-- 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) 	npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) 	npcHandler:onCreatureSay(cid, type, msg) 	end
function onThink()  npcHandler:onThink() end


function doHandleItems(cid, msg, str, reward, items)
	if msgcontains(msg, str) then
		for _, itemTable in pairs(items) do
			if (getPlayerItemCount(cid, itemTable.itemid, itemTable.count) < 1) then
				return false
			end
		end
	end
	for _, itemTable in pairs(arg) do
		doPlayerRemoveItem(cid, itemTable.itemid, itemTable.count)
	end
	selfSay("Enchantment completed, here's your weapon.")
	doPlayerAddItem(cid, reward) --- Spike sword with fire enchant
end

function creatureSayCallback(cid, type, msg)
	if not doHandleItems(cid, msg, "spike sword", 7744, {
		{itemid=2152, count=60}, -- 60 platinum coins
		{itemid=2795, count=5}, -- 5 fire mushrooms
		{itemid=2383, count=1} -- spike sword
	}) and
	doHandleItems(cid, msg, "barbarian axe", 7749, {
		{itemid=2152, count=60}, -- 60 platinum coins
		{itemid=2795, count=5}, -- 5 fire mushrooms
		{itemid=2429, count=1} -- barbarian axe
	}) and
	doHandleItems(cid, msg, "relic sword", 7745, {
		{itemid=2152, count=60}, -- 60 platinum coins
		{itemid=2795, count=5}, -- 5 fire mushrooms
		{itemid=7383, count=1} -- relic sword
	}) then
		selfSay('I need a weapon, and its ingredients, I also want 6k as paymenth for this job.')
		talk_state = 0
	end
	if msgcontains(msg, 'no') then
		selfSay('Maybe another time then.')
		talk_state = 0
	end
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Just an experiment huahau xD
 
I think I will wait for Empty's scripts, even though your example gives less lines. He will fix it today, and like to have the scripts in same way :)

I did some spelling misstakes, etc heres instead of here's like you fixed, but i'll fix it too :) thx anyway

 
Back
Top