Jump to content

Problem with a little function in quest


Recommended Posts

 

Hi, i have a problem with "if" in my quest.

 

This quest looks like:

 


when xxx.use begin

 

[...]

 

if pc.get_skill_group() != 1 and pc.get_job() != 0 or pc.get_job() != 4 then
    syschat("["..item.get_name().."]".." you are not a warrior body")
    return

end

 

Translate: When im not a BODY and WARRIOR MEN or WOMAN, return...

but when i try use item on warrior with skills BODY, i got syschat "you are not a warrior body"

 

Really i don't know why this doesn't work, this is a simple function, somebody have idea whats wrong?

 

Best regards.

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

quest test begin
	state start begin
		when login begin
			set_state(information)
		end
	end
	state information begin
		when letter begin
			send_letter("Test")
		end
		when button or info begin
			if pc.get_skill_group() == 1 and pc.get_job() == 0 or pc.get_job() == 4 then
				say_title("Test")
				say("")
				say("You are a warrior body. (man/woman)")
				say("")
				clear_letter()
			else
				say_title("Test")
				say("")
				say("You are not a warrior body. (man/woman)")
				say("")
				clear_letter()
			end
		end
	end
end
if not pc.get_skill_group() == 1 and pc.get_job() == 0 or pc.get_job() == 4 then
	syschat("["..item.get_name().."]".." you are not a warrior body")
	return
end
quest test2 begin
	state start begin
		when login begin
			set_state(information)
		end
	end
	state information begin
		when letter begin
			send_letter("Test2")
		end
		when button or info begin
			if not pc.get_skill_group() == 1 and pc.get_job() == 0 or pc.get_job() == 4 then
				say_title("Test2")
				say("")
				say("You are not a warrior body. (man/woman)")
				say("")
				clear_letter()
			else
				say_title("Test2")
				say("")
				say("You are a warrior body. (man/woman)")
				say("")
				clear_letter()
			end
		end
	end
end

 

Edited by Cunoo
Link to comment
Share on other sites

@Cunoo

 

When i change my line of "if" to "if not pc.get_skill_group() == 1 and pc.get_job()== 0 or pc.get_job() == 4 then

i doesn't work, when i change pc.get_skill_group() == 1 to pc.get_skill_group() == 2 (MENTAL) i can use item.

 

Thanks for quests but in my case i can't use like this:

 

if bla bla

   bla bla

else <---- with else

  bla bla

 

I have to include this "if" to this list:

 

when xxx.use begin

 

if pc.get_skill_group() == 0 then
                syschat("...")
                return
            end

if table.getn(vnum_list) == 0 then
                syschat("...")
                return
            end
            
if pc.count_item(50513) == 0 then
                syschat("..")
                return
            end
            
 if not pc.can_warp() then
                syschat("..")
                return
            end

 

----- HERE TO SPEACE FOR IF --

 

"if" must end with return end :)

Link to comment
Share on other sites

  • Premium
1 hour ago, Zoom said:

@Cunoo

 

When i change my line of "if" to "if not pc.get_skill_group() == 1 and pc.get_job()== 0 or pc.get_job() == 4 then

i doesn't work, when i change pc.get_skill_group() == 1 to pc.get_skill_group() == 2 (MENTAL) i can use item.

 

Thanks for quests but in my case i can't use like this:

 

if bla bla

   bla bla

else <---- with else

  bla bla

 

I have to include this "if" to this list:

 

when xxx.use begin

 

if pc.get_skill_group() == 0 then
                syschat("...")
                return
            end

if table.getn(vnum_list) == 0 then
                syschat("...")
                return
            end
            
if pc.count_item(50513) == 0 then
                syschat("..")
                return
            end
            
 if not pc.can_warp() then
                syschat("..")
                return
            end

 

----- HERE TO SPEACE FOR IF --

 

"if" must end with return end :)

weed GIF

Edited by Metin2 Dev
Core X - External 2 Internal
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



  • Similar Content

  • Activity

    1. 2

      Feeding game source to LLM

    2. 0

      Target Information System

    3. 2

      Feeding game source to LLM

    4. 2

      anti exp explanation pls

    5. 2

      Feeding game source to LLM

    6. 2

      anti exp explanation pls

    7. 0

      [GR2] Positioning an object added with "Attach"

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.