i have a If/ else if / else function in my script. Where player get item via getitem. If i use ony onetime "getitem" the script worked but if i add more than one "getitem" into the statsment the script dont work and create error at the mapserver:
Dont work (3 getitem via)
if (.@checker_level > 9)
getitem 509, rand(20, 50); // white herb
getitem 510, rand(1, 10); // Blue herb
getitem 521, rand(1, 5); // Aloe Leaf
else if (.@checker_level > 19)
getitem 509, rand(45, 85); // white herb
getitem 510, rand(9, 25); // Blue herb
getitem 521, rand(15, 35); // Aloe Leaf
else
getitem 507, rand( 10, 75); // red herb
getitem 508, rand(1, 10); // yellow herb
Work (only one getitem via if)
if (.@checker_level > 9)
getitem 509, rand(20, 50); // white herb
//getitem 510, rand(1, 10); // Blue herb
//getitem 521, rand(1, 5); // Aloe Leaf
else if (.@checker_level > 19)
getitem 509, rand(45, 85); // white herb
//getitem 510, rand(9, 25); // Blue herb
//getitem 521, rand(15, 35); // Aloe Leaf
else
getitem 507, rand( 10, 75); // red herb
//getitem 508, rand(1, 10); // yellow herb
Error:
[Error]: Loading NPC file: npc/custom/script.txt
script error on npc/custom/tree_script.txt line 98 parse_line: expect command, missing function name or calling undeclared function
Question
Vincent
Hi,
i have a If/ else if / else function in my script. Where player get item via getitem. If i use ony onetime "getitem" the script worked but if i add more than one "getitem" into the statsment the script dont work and create error at the mapserver:
Dont work (3 getitem via)
Work (only one getitem via if)
Error:
Edited by Loco3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.