Jump to content
  • 0

Freebies Error


Markyieee

Question


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  134
  • Reputation:   4
  • Joined:  06/14/12
  • Last Seen:  

I got this error.

 
[Error]: chat_createnpcchat: npc 'Freebies' already has a chatroom, cannot create new one!
 
This is my script
 
prontera,159,190,4 script Freebies 461,{

mes "Hello";

mes "I can give you a free gift based on your future job.";

mes "Please choose the correct item for the future job";

if(!#Freebie) {

  mes "Select one:";

  next;

  switch(select("Swordsman:Magician:Archer:Monk:Merchant:Thief")) {

   case 1:

    getitem 20113,1;

    getitem 20114,1;

    getitem 20115,1;

    getitem 20116,1;

    getitem 4305,5;

    getitem 4142,1;

    getitem 20094,2;

    getitem 20077,1;

    getitem 20017,1;

    getitem 4302,1;

    getitem 4047,1;

    getitem 4174,1;

    getitem 4128,1;

    break;

   case 2:

    getitem 20113,1;

    getitem 20114,1;

    getitem 20115,1;

    getitem 20116,1;

    getitem 4305,5;

    getitem 4142,1;

    getitem 20094,2;

    getitem 5138,1;

    getitem 20059,1;

    getitem 4302,1;

    getitem 4047,1;

    getitem 4174,1;

    getitem 4128,1;

    break;

   case 3:

    getitem 20113,1;

    getitem 20114,1;

    getitem 20115,1;

    getitem 20116,1;

    getitem 4305,5;

    getitem 4142,1;

    getitem 20094,2;

    getitem 20080,1;

    getitem 20073,1;

    getitem 4302,1;

    getitem 4047,1;

    getitem 4174,1;

    getitem 4128,1;

    break;

   

   case 4:

    getitem 20113,1;

    getitem 20114,1;

    getitem 20115,1;

    getitem 20116,1;

    getitem 4305,5;

    getitem 4142,1;

    getitem 20094,2;

    getitem 20072,1;

    getitem 20077,1;

    getitem 4302,1;

    getitem 4047,1;

    getitem 4174,1;

    getitem 4128,1;

    break;

  

   case 5:

    getitem 20113,1;

    getitem 20114,1;

    getitem 20115,1;

    getitem 20116,1;

    getitem 4305,5;

    getitem 4142,1;

    getitem 20094,2;

    getitem 20077,1;

    getitem 20017,1;

    getitem 4302,1;

    getitem 4047,1;

    getitem 4174,1;

    getitem 4128,1;

    break;

  

   case 6:

    getitem 20113,1;

    getitem 20114,1;

    getitem 20115,1;

    getitem 20116,1;

    getitem 4305,5;

    getitem 4142,1;

    getitem 20094,2;

    getitem 20077,1;

    getitem 20017,1;

    getitem 4302,1;

    getitem 4047,1;

    getitem 4174,1;

    getitem 4128,1;

    break;

   }

   set #Freebie, 1;

   close;

}

OnInit:

waitingroom "Get your freebies here ! ",0;

end;

}

 
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   19
  • Joined:  07/02/12
  • Last Seen:  

I think you should try like this:

....
getitem 4302,1;
getitem 4047,1;
getitem 4174,1;
getitem 4128,1;
break;
}
set #Freebie, 1;
end;
}
OnInit:
waitingroom "Get your freebies here ! ",0;
end;
}

 

Because the "break;" make your script continue after the }, and the "close;" close only the chat with the NPC.

 

So after the #Freebie is set to one, the script continues and try to open a new chatroom.

 

I'm not sure, but i think it is the problem

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

Tanos92 is right, Also please use a code box when your posting a script

[codebox] like this [/ codebox]
Edited by Stolao
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  42
  • Topics Per Day:  0.01
  • Content Count:  134
  • Reputation:   4
  • Joined:  06/14/12
  • Last Seen:  

Thank you both :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...