ID:268030
 
So far, I have this:

obj
Red_Flag
density = 1
icon = 'Red Flag.dmi'
Bumped(mob/M)
if(istype(M, /mob))
src.loc = M
usr.overlays += 'Red Flag.dmi'
usr <<"You have the Red Flag!"
world <<"<font color=red><font size=3><B>[usr] has the Red Flag!"


What I want is, if the usr is on the red team, they can't pick up the flag. But if on the blue team, they can.

~~SSJ4_Gohan_Majin
No put usr in proc. Ungh.

Lummox JR
First of all, usr is not something you should be using in this situation. The Bumped() proc refers to M as the mob that bumped src, so you want to refer to M, not usr.

And all you need is another if() in there to check the player's team color variable. Something like this:

obj

Red_Flag
density = 1
icon = 'Red Flag.dmi'
Bumped(mob/M)
if(istype(M, /mob))
if(M.team == "Blue")
src.loc = M
M.overlays += src.icon
world << "<font color=red size=3><b>[M] has the [src]!</b></font>"

Blue_Flag
density = 1
icon = 'Blue Flag.dmi'
Bumped(mob/M)
if(istype(M, /mob))
if(M.team == "Red")
src.loc = M
M.overlays += src.icon
world << "<font color=red size=3><b>[M] has the [src]!</b></font>"<dm>