ID:175504
 
Bump(atom/movable/A)
A.random = rand(1,4)
if(A.random == 1)
A<<"<b>[src]: Darn Frieza and his army...they've destroyed everything on our planet!"
if(A.random == 2)
A<<"<b>[src]: Frieza and his army are located somewhere's in SouthEastern region."
if(A>random == 3)
A<<"<b>[src]: "
if(A.random==4&&src.name=="Nale"&&usr.maxpowerlevel>=75000&&usr.will>=35&&usr.purity>=35&&usr.honor>=35)
A<<"<b>[src]: I must do something to help my people! Wait...I know..."
switch(alert(usr,"Do you wish to fuse with [src]?","Fuse","Yes","No"))
if("Yes")
A:SNJ()
del(src)
else
A<<"<b>[src]: Alright..."

This doesn't seem to work for me why? I have been trying to find the problem with no sucess.
Where is your bump defined? Are you sure you want it give the usr a message for ANY atom he bumps?
Coolroman123 wrote:
> Bump(atom/movable/A)
> A.random = rand(1,4)
> if(A.random == 1)
> A<<"<b>[src]: Darn Frieza and his army...they've destroyed everything on our planet!"
> if(A.random == 2)
> A<<"<b>[src]: Frieza and his army are located somewhere's in SouthEastern region."
> if(A>random == 3)
> A<<"<b>[src]: "
> if(A.random==4&&src.name=="Nale"&&usr.maxpowerlevel>=75000&&usr.will>=35&&usr.purity>=35&&usr.honor>=35)
> A<<"<b>[src]: I must do something to help my people! Wait...I know..."
> switch(alert(usr,"Do you wish to fuse with [src]?","Fuse","Yes","No"))
> if("Yes")
> A:SNJ()
> del(src)
> else
> A<<"<b>[src]: Alright..."
>

This doesn't seem to work for me why? I have been trying to find the problem with no sucess.

This is a pretty messy. I suggest a new way of doing this..

People often use user made Bumped() procedures, to call certain things when an atom is bumped. What you need to do, is first define a Bumped() procedure for all atoms..
atom/proc/Bumped(atom/A)

Simple enough. Then, you must have a way of calling the Bumped() procedure.
atom/movable/Bump(atom/A)
..()
A.Bumped(src)


I called the parent procedure first, so it's sure not to overwrite any previous Bump() procedures you may have made.

As for the new method of doing your little message thing, you should use switch(), along with rand(). I suggest something like the following;
mob/Guy
Bumped(mob/M)
if(ismob(M)) // Make sure what bumped it is a mob.
switch(rand(1,3))
if(1) M<<"[src.name] says, \"Hey! Watch it!\""
if(2) M<<"[src.name] says, \"Just learning to walk, pal?!\""
if(3) M<<"[src.name] pushes you."


I hope this helps you out.

~>Volte
In response to Volte
THx it worked