Jump to content

Recommended Posts

  • Active+ Member

Hello devs, as you may have noticed I'm one of the noobiest devs around here so I need your help today don't worry it's something simple :P
Alright so I need a simple LUA function. I have this array of skills

Spoiler

local anti_skill_list = {221, 222, 223, 224, 225, 226, 227, 228, 229}

and I want to check if some of them is Perfect Master and if it's not then say("You can't do this until one of these skills are Perfect Master and blah blah blah...")

Just that :)

So thank you in advance guys I appreciate every comment I get :)

 

EDIT: I got it don't worry about it :P

Link to comment
https://metin2.dev/topic/12920-noob-request-psearching-for-lua-function/
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

function check(vnum,arr)
    all_ok = false
    for i = 1,table.getn(arr) do
        if pc.get_skill_level(arr) >= 40 then all_ok = true
        elseif pc.get_skill_level(arr) < 40 then all_ok = false end
    end
    return all_ok
end

  • Love 1
  • Active+ Member

Thanks for the reply @Denis I did it in a different way tho,

Spoiler

            PERFECT_MASTER_SKILL_LEVEL = 40
            local ward_perfect = 0
            local new_skill_list = {221, 222, 223, 224, 225, 226, 227, 228, 229}
            for i = 1, table.getn(new_skill_list) do
                skill_vnum = new_skill_list
                if pc.get_skill_level(skill_vnum) == PERFECT_MASTER_SKILL_LEVEL then
                    ward_perfect = 1
                end
            end
            
            if ward_perfect != 1 then
                say("Sorry, you need a Perfect Master and blah blah blah...")
                say("")
                return
            end

 

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.