Jump to content
  • 0

[Error] Script Kill Monster get Cash


ooGubAoo

Question


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.03
  • Content Count:  55
  • Reputation:   1
  • Joined:  06/08/23
  • Last Seen:  

-	script	Kill2Cash	-1,{

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

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

end;

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

}

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  776
  • Reputation:   239
  • Joined:  02/11/17
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.03
  • Content Count:  55
  • Reputation:   1
  • Joined:  06/08/23
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  78
  • Reputation:   19
  • Joined:  12/24/18
  • Last Seen:  

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;

}

 

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