obj
C4
icon = 'explosive.dmi'
icon_state = "c4"
density=1
Bump(A)
if(ismob(A))
var/mob/M = A
var/damage = round(src.tai*20)
M.hp -= damage
view(M) << "[M] was hit by Haretsu Horimono Nendo for [damage] damage!"
src.Frozen = 1
for (var/turf/X in view(5))//If it is withing 3 tiles of the "Explosion"...
X.overlays+='explosion.dmi'//Overlay the Explosion icon
spawn(5)//Wait a little bit
X.overlays+='dirt.dmi'
sleep(30)
X.overlays.Cut()//Delete the explosion, not all things last forever :)
M.Killer = Gowner
M.Death(usr)
sleep(5)
del(src)
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del(src)
if(istype(A,/obj/))
del(src)
Problem description:It just doens't create the Explosion Effect... making those overlays on the turfs (X) working... Please help me...
Least critically:
There is no reason to include if() branches for /obj and /turf in this specific example, simply because nothing is done within them. Delete the last two if() statements and back-tab the del(src) at the end of the ismob() block.
Secondly, I'm not entirely sure if you're aware that delays within spawn() and sleep() are in ticks and not seconds. There are ten ticks in a second, so your spawn(5) statement means the explosion will remain for one half of a second, and not five seconds.
Immediately pertinent to the problem:
view() has two arguments in the order distance,center. Center defaults to usr, which is nonexistant in this case; view() returns nothing because there is no usr in this case.
spawn() is a tabbed construct like if(); your use of spawn() does nothing because there is no code tabbed after it. Your use of sleep(), however, is correct.
After taking these into consideration, you seem competent enough to solve the problems that remain.