ID:261996
 
turf/fire
icon = 'turfs.dmi'
icon_state = "fir3"
Entered(mob/m)
m << "BOOM!"
view(4)<<"[m] stepped on fire"
m.health-=50
m.deathcheck(m)
del (src)


The code does what its supposed to but it gets rid of the turf that was originally layed on the map i tried making it an obj but it just didnt work, is there a way of doing this so the turf originaly layed down wont get deleted or if i make it an obj it will work? Thanks
- VASH
There is only ever one turf on each tile. When you put mutliple turfs on top of each other, it deletes the old turf and adds it to underlays.

And you need an if(ismob(m)) check in there.
[link] Read through that thread. (The forum search function is your friend, get to know it.)
In response to Shadowdarke
I just looked at that page and something near the bottom didn't look right.
obj
item_grabber
// stores any items set in this turf, and items that pass over the turf
Triggered(O)
// grab any obj that entered the turf
if(isobj(O)) // see if the victim is a mob
var/obj/Obj = O // create an obj alias to O
world << "The item grabber grabbed [Obj]!"
Obj.Move(src) // Move the obj inside of the grabber

You have "if(isobj(O)) //see if the victim is a mob" when isobj will see if it is an obj, not a mob. Then you have "var/obj/Obj = O" which will set Obj to the mob that entered. According to that, if my mob were to step on the thing, and if my mob's name is equal to my key, it should say "The item grabber grabbed Loduwijk!" then make my mob call Move(src), putting my mob inside the item grabber.

I think what you want is this:
obj/item_grabber/Triggered(O)
if(ismob(O))
var/mob/M=O
var/obj/Obj=locate(/obj) in M
if(Obj)
world << "The item grabber grabbed [Obj]!"
Obj.Move(src)
In response to Loduwijk
It is supposed to check if O is an obj, just to demonstrate that it doesn't have to be mobs triggering the obj. The comment was incorrect. Everything else is fine as it was.

If you want to add other examples, like something that steals objs from mobs, feel free. It is a Bwicki page. :)