ID:146263
 

mob
verb
Attack(mob/M as mob in oview(1))
set category = "Fighting"
var/damage = round(usr.Strength*2 - M.Defense)+20
if(damage <= 0)
usr << "[M] easily dodges your attack!"
M << "You easily dodge [usr]'s attack."
var/punch = rand(1,2)
if(punch = 1)
flick("Punch1",usr)
else
flick("Punch2",usr)
else
M.PL -= damage
view() << "[usr] attacks [M] for [damage] HP!"
M:deathcheck()
usr.MaxPL += 50
usr.Strength += 10
usr.Defense += 7
if(usr.Stamina >= 3)
Attack()
else
usr << "You don't have enough stamina!"


Problem description: The rand() usr flick wont work

You need to use =='s in if() statements. = is for setting a value and == for checking, I believe.
Also, I think you can replace
                var/punch = rand(1,2)
if(punch = 1)
flick("Punch1",usr)
else
flick("Punch2",usr)

with
flick(pick("Punch1","Punch2"),usr)
In response to Artekia
wont that give the usr the option to pick it then?
In response to CYN
The pick() function randomly picks an arguement that you put in. If I did pick(1,1,2) it'd have a 66.6% chance of picking 1 and a 33.3% chance of picking 2.
In response to CYN
No, pick selects a random argument...
In response to Artekia
ok thanks, dont suppose you could look at the login problem on my other post :D