ID:1085117
 
Code:
mob
verb
fireball()
set src in view()
set hidden = 1
if(!usr.targeting)
usr<<"Target an enemy to use this spell!"
return
else
var/mob/j = usr.Tgt
if(j in oview(usr,usr.client.view))
var/obj/fireball/K = new /obj/fireball
K.loc = usr.loc
walk_towards(K,j.loc)
for(var/mob/M in get_step(src,usr.dir))
if(M.enemy == 1)
var/damage=((round(usr.mdamage+(usr.int/4))-M.mdef))
if(damage>0)
M.hp-=damage
view() <<"[src.Name] hit [M] for [damage]!"
usr.DeathCheck(M)
else
view() <<"[M] absorbed the blow!"
else
usr<<"You cannot attack [M.Name]!"
usr.attacking = 1
spawn(usr.aspd*0.6)
usr.attacking=0
sleep(15)
del(K)


Problem description:
Projectile (fireball) starts and homes in on target mob. When the projectile gets there nothing happens. It hangs and then deletes itself when it times out.

I'm sure its something obvious, but I've been fiddling with it for a while and can't figure it out. Thank you :)
Just make damage proc inside fireball's Bump().
Bump(A)
if(ismob(A))
damage
if(istype(A,/turf/))
var/turf/T = A
if(T.density)
del src
if(istype(A,/obj/))
del src
mob
verb
fireball() // The verb
// set src in view() <-- Uneeded for a verb
set hidden = 1 // Your call about this one, hidding it or not.
if(!usr.targeting) // If the user doesn't have a target
usr<<"Target an enemy to use this spell!" // Output text
return // Stop the process by returning null
else // If the user does have a target
if(usr.Tgt in oview(usr,usr.client.view)) // If the target is in the user's client view
var/obj/fireball/K = new /obj/fireball // Create a fireball object
K.loc = usr.loc // Set it's location onto yourself
K.damage = round(usr.mdamage+(usr.int/4)) // Set it's damage
K.target = usr.Tgt // Set it's target to chase, which is the users.
K.range = usr.client.view // Set it's range to ensure it won't chase someone out of your view
usr.attacking = 1 // Set a var to 1
spawn(usr.aspd*0.6) // Wait for the reset, while skipping to the sleep()
usr.attacking=0 // Set a var to 0
sleep(15) // Wait 1.5 second(s)
del(K) // Delete K
obj
fireball // The fireball
density = 1 // Make it able to hit people
var // It's vars
damage // The damage
target // It's target
range // It's range
New() // When spawned
if(src.damage&&src.target&&src.range) // Check if there is a var in everything
src.walk2() // Then start it's attack
else // If everything isn't filled.
del src // Delete the fireball
Bump(atom/M) // If the fireball hits someone continue.
if(ismob(M)) // If it's a mob it hits
if(M == target) // If it's the target
M.hp -= damage-M.mdef // Damage the target
view(src) << "[M] took [damage-M.mdef] damage from [src]!" // Output the damage in a text
del src // Delete the fireball
proc // A process
walk2() // The process name
walk_towards(src,target) // Continue walking towards your target til the fireball gets deleten by the 1.5 second(s) on the fireball verb.

I hope this helped, and since I couldn't compile then I'm not sure if there is any errors/warnings.
Thanks to both of you! Helped very much. Trying it now, I really appreciate it!