ID:159257
 
mob/Login()
src.random = rand (1,2)
if(src.rand == 1)
src.loc = locate(123,7,2)
if(src.rand == 2)
src.loc = locate(107,7,2)


so my problem is i want it it to randomizt the login screens because i have 2 of them but i keep geting this

Naruto Ultimate Ninja Heroes.dm:7:error:rand:undefined proc
Naruto Ultimate Ninja Heroes.dm:8:error:src.rand:undefined var
Naruto Ultimate Ninja Heroes.dm:10:error:src.rand:undefined var
Naruto Ultimate Ninja Heroes.dm:8:error::invalid expression
Well, for starters, it should be
if(src.random == 1)
sense thats what you defined the var as.
In response to Xyphon101
Xyphon101 wrote:
Well, for starters, it should be
if(src.random == 1)
sense thats what you defined the var as.
fixed 2 of the errors but im still getin these 2

Naruto Ultimate Ninja Heroes.dm:7:error:rand:undefined proc
Naruto Ultimate Ninja Heroes.dm:8:error::invalid expression
nvm fixed it myself thxs aanyway
rand() is a built in proc, not a variable as you seem to think it is in your snippet. You shouldn't make an atom variable for it; only local variables to hold the value.

mob/Login()
..()
switch(rand(1,2)) //in this case, switch is even better...
if(1) Move(locate(123,7,2))
if(2) Move(locate(107,7,2))
In response to Spunky_Girl
Even better, you can use a quick pick(). :D
mob/Login()
..()
src.Move(locate(pick(123,107),7,2))

(Though you'll most likely want something a little more reliable than Move() for this kind of movement, at the very least making sure it occurs with a followup direct loc set.)
In response to Kaioken
I was just thinking about the pick() proc actually! >.<