ID:140163
 
Code:
obj
Shuriken
name = "Shuriken"
//dont have a base icon so cant make weights icon!lol
icon='projectile weapons.dmi'
icon_state="shuriken"
density=1
oname="Shuriken"
Bump(A)
if(istype(A,/mob/))
var/obj/Shuriken/L=new();L.loc=usr

spawn(10)
spawn(5)
del(L)
for(var/mob/M in view(L))
var/damage = round(usr.Str*1.5);damage+=rand(1,damage/1.5)
view(M)<<"[M] takes [damage] damage from the Shuriken"
M.Hp-=damage;M.Death()


Problem description:

ok this isnt the whole code i have throw in place it leaves the user perfectly ,but then when it comes in contact with i.e a npc it doesnt delete, im wondering what have i done wrong?
Probably because you are not actually deleting it at any point.

Also using usr in procs. You shouldn't do that. What you should have is something like this:

obj/projectile
var/distance = 10
var/delay = 5
var/tmp/mob/owner
New(var/mob/M)
..()
owner = M
loc = M.loc
dir = M.dir
spawn() moveloop()

proc
moveloop()
// Take distance steps
while(distance > 0)
distance--
// If a step fails, look for a mob in the turf in front of us
if(!step(src,dir))
var/mob/M = locate() in get_step(src,dir)
// If we find one, hurt them
if(M)
var/damage = owner.Str
M.takedamage(damage, owner)

mob
proc
takedamage(var/damage, var/attacker)
view(src) << "[attacker] hits [src] for [damage]"
hp -= damage
if(hp <= 0)
src.die(attacker)

die(var/attacker)
view(src) << "[src] has been killed by [attacker]"
// Blah blah blah


I included the takedamage stuff because you were probably also abusing usr in Death() as well.
In response to Garthor
ok thnx and nah i aint abused usr in my death lol it just slipped y mind in this