Active Member Mind Rapist 188 Posted August 3, 2016 Active Member Share Posted August 3, 2016 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 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 Link to comment Share on other sites More sharing options...
Denis 1474 Posted August 3, 2016 Share Posted August 3, 2016 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 1 Link to comment Share on other sites More sharing options...
Active Member Mind Rapist 188 Posted August 3, 2016 Author Active Member Share Posted August 3, 2016 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now