ID:175321
 
I want this explosion to appear in a random slection of places. I tried:
mob
explosion
var/x
var/y
if(rand == 1)
x = 4
y = rand(76,78)
if(rand == 2)
x = 5
y = rand(75,79)
if(rand == 3)
x = 6
y = rand(74,80)
if(rand == 4)
x = 7
y = rand(73,81)
if(rand == 5)
x = 8
y = rand(73,82)
if(rand == 6)
x = 9
y = rand(73,82)
if(rand == 7)
x = 10
y = rand(74,82)
if(rand == 8)
x = 11
y = rand(75,81)
if(rand == 9)
x = 12
y = rand(76,80)
if(rand == 10)
x = 13
y = rand(77,79)
loc = (x,y,2)

but this doesn't work, can anyone point me in the right direction?
mob
explosion/New()
rand(1,10)
if(rand == 1)
src.x = 4
src.y = rand(76,78)
if(rand == 2)
src.x = 5
src.y = rand(75,79)
if(rand == 3)
src.x = 6
src.y = rand(74,80)
if(rand == 4)
src.x = 7
src.y = rand(73,81)
if(rand == 5)
src.x = 8
src.y = rand(73,82)
if(rand == 6)
src.x = 9
src.y = rand(73,82)
if(rand == 7)
src.x = 10
src.y = rand(74,82)
if(rand == 8)
src.x = 11
src.y = rand(75,81)
if(rand == 9)
src.x = 12
src.y = rand(76,80)
if(rand == 10)
src.x = 13
src.y = rand(77,79)



Try that.

n00bie,
<font color = red>The Cra Zee Coder</font>
loc = locate(rand(4,13),rand(73,82),2)
Do what Garthor said, you dont want to crowd up your coding(in my opinion). If you dont understand it still just ask me.