How can i make this work, im using pi. Basicly im trying so it gives u random pkp each time u kill someone.
Code:
int random = 2+misc.random(3);
if(random == 0)
o.pkpoints += 30;
o.sendMessage ("You get 30 Pk points. You have now "+o.pkpoints+".");
if(random == 1)
o.pkpoints += 40;
o.sendMessage ("You get 40 Pk points. You have now "+o.pkpoints+".");
if(random == 2)
o.pkpoints += 50;
o.sendMessage ("You get 50 Pk points. You have now "+o.pkpoints+".");
if(random == 3)
o.pkpoints += 60;
o.sendMessage ("You get 60 Pk points. You have now "+o.pkpoints+".");
if(random == 4)
o.pkpoints += 80;
o.sendMessage ("You get 80 Pk points. You have now "+o.pkpoints+".");
if(random == 5)
o.pkpoints += 100;
o.sendMessage ("You get 100 Pk points. You have now "+o.pkpoints+".");
This is the errors i get
Code:
src\server\model\players\PlayerAssistant.java:941: cannot find symbol
symbol : variable misc
location: class server.model.players.PlayerAssistant
int random = 2+misc.random(3);
^
src\server\model\players\PlayerAssistant.java:941: operator + cannot be applied
to int,misc.random
int random = 2+misc.random(3);
^
src\server\model\players\PlayerAssistant.java:941: incompatible types
found : <nulltype>
required: int
int random = 2+misc.random(3);
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
Press any key to continue . . .