Jump to content

Recommended Posts

Hi dev, actually im trying to put a range of lv in a party:

 

Like min lv 20 max lv 25.

 

i do this:

			if not party.is_party() then
				say("Sorry, you need party for enter in the dungeon")
				return
			end

				local pids = {party.get_member_pids()}
				local notEnoughLevelMembers = {}
				local levelCheck = true
					for i, pid in next, pids, nil do

					q.begin_other_pc_block(pid)

						if pc.get_level() >= 80 and pc.get_level() <= 50 then
							table.insert(notEnoughLevelMembers, pc.get_name())
							levelCheck = false
						end	

					q.end_other_pc_block()

					end

					if not levelCheck then
						say_title(mob_name(20030))
						say("Sorry, the next members don't are in the range of lv")
						for i, name in next, notEnoughLevelMembers, nil do
							say("    "..name)
						end

						return
					end	

					if party.is_leader() then
						say("You are the leader")
						else
						say("You aren't the leader")
					end

But the result is :

 

669db19429.jpg

 

Any idea?

Edited by Metin2 Dev
Core X - External 2 Internal

:D

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Developer
if pc.get_level() >= 80 and pc.get_level() <= 50 then

Wtf... How can this ever be possible? Whatever your level is, this codition is always false, you're saying this:

if the players' level is superior or equal than 80 and minor or equal than 50 then do something

 

But how can a number be >= 80 and at the same time <= 50? Try this anyway:

if pc.get_level() >= 50 and pc.get_level() <= 80 then

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.