ID:140975
 
Code:
fiver
icon_state = "5"
New()
..()
spawn(150)//mpve lasts 15 secs
del src

Entered(mob/a)
..()
if(ismob(a))
var/mob/O=a
O.inwater=1//in the move proc add the water move. also for suuton water drag.
Exited(mob/a)
..()
if(ismob(a))
var/mob/O=a
O.inwater=0
O.canregen=1


Problem description:
The code works well but when the turf is deleted, everything else on the map where the turf was is also deleted like the grass and path. it just leaves a balck spot.

Could it be the other turfs enetering the turfs content list?

Should i make the turf an obj instead?
Ehm, I believe when you delete a turf, it deletes all turfs located within that map location. I think you would be much better off using an obj for this affair, as you mentioned.
That too, but why the heck are you not using the mob/a argument? Instead you create a new var (var/mob/o) and set it to a... why?
Turfs are not in other turf's contents list. Creating a new turf deletes an old turf. The only reason you think it doesn't is because there's a purely graphical effect of the old turfs' icons being added to the new turf's underlays.

So, yes, you should be using an /obj.
using obj instead the code is as follows:

obj
terrainset
icon = 'Terrainset.dmi'
icon_state = ""
fiver
icon_state = "5"
New()
..()
spawn(150)//mpve lasts 15 secs
del src

Entered(a)
..()
if(ismob(a))
var/mob/O=a
O.inwater=1//in the move proc add the water move. also for suuton water drag.
Exited(a)
..()
if(ismob(a))
var/mob/O=a
O.inwater=0
O.canregen=1



No wht problem is the Entered() and Exited() procs no longer have effect even though the obj deletes 15 seconds after creation
In response to Rapmaster
Because you aren't entering or exiting the objs. You'll need to write a proc to handle that, search the forum for "StepOn" or "Trigger" because it's been posted about a million times.
In response to Garthor
Thats what im currently doing. Sorry should have searched before posting a new question.