Jump to content
  • 0

[Error] Script Kill Monster get Cash


Question

Posted
-	script	Kill2Cash	-1,{

OnNPCKillEvent:
#CASHPOINTS = #CASHPOINTS + .@R;

dispbottom "รับ : "+ .@R +" Cash รวม : "+ #CASHPOINTS +" Cash"; }

end;

OnInit:
set .@R,50; //cashpoints per kill
end;

}

 

3 answers to this question

Recommended Posts

  • 0
Posted
-	script	Kill2Cash	-1,{

OnNPCKillEvent:
#CASHPOINTS += .r;

dispbottom "รับ : "+ .r +" Cash รวม : "+ #CASHPOINTS +" Cash"; }

end;

OnInit:
	.r = 50; //cashpoints per kill
end;

}

You are using temporary npc variables.

  • 0
Posted (edited)
18 hours ago, crazyarashi said:
-	script	Kill2Cash	-1,{

OnNPCKillEvent:
#CASHPOINTS += .r;

dispbottom "รับ : "+ .r +" Cash รวม : "+ #CASHPOINTS +" Cash"; }

end;

OnInit:
	.r = 50; //cashpoints per kill
end;

}

You are using temporary npc variables.

Oh. I must change dispbottom "รับ : "+ .r +" Cash รวม : "+ #CASHPOINTS +" Cash"; } to dispbottom "รับ : "+ .r +" Cash รวม : "+ #CASHPOINTS +" Cash"; 

and i need kill monster 50 to 1 point

but this 1 cash per kill

Edited by ooGubAoo
  • 0
Posted
3 hours ago, ooGubAoo said:

Oh. I must change dispbottom "รับ : "+ .r +" Cash รวม : "+ #CASHPOINTS +" Cash"; } to dispbottom "รับ : "+ .r +" Cash รวม : "+ #CASHPOINTS +" Cash"; 

and i need kill monster 50 to 1 point

but this 1 cash per kill

Try 

- script Kill2Cash -1,{
OnInit:
    .killCount = 0;
    .pointsPerKill = 50;
    end;

OnNPCKillEvent:
    .killCount++;

    if (.killCount >= .pointsPerKill) {
        #CASHPOINTS += 1;
        .killCount -= .pointsPerKill;
        dispbottom "รับ : 1 Cash รวม : " + #CASHPOINTS + " Cash";
    }
    end;

}

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...