ID:176482
 
For some reason with this line:

var/goldgiven = rand(1,15)

I get the error:

attack.dm:32:error:= :expected a constant expression

Could ya help me fix this? Thanks in advance!

-Crio
Koolguy900095 wrote:
For some reason with this line:

var/goldgiven = rand(1,15)

I get the error:

attack.dm:32:error:= :expected a constant expression

Could ya help me fix this? Thanks in advance!

-Crio

When defining object variables you can only have them initialized to a constant. rand(1,15) is an expresion that isn't constant. If you want a random amount for gold, set goldgiven in the objects New() proc.