ID:143617
 
Code:
obj
Spell_Items
icon = 'M - Spells.dmi'
Fireball
icon_state = "Fire Ball"
Bump(/mob/Characters/)
usr.HP -= 25
del src
var
Mdir = NORTH
New()
Move(NORTH,1)
Move(NORTH,1)
Move(NORTH,1)
Move(NORTH,1)
Move(NORTH,1)
Move(NORTH,1)
Move(NORTH,1)
del src


mob/proc
Fireball()
set category = "Magic"
if(usr.Mana >= 0)
new /obj/Spell_Items/Fireball(usr.loc,Mdir = usr.dir)
usr.Mana -= 1
else
usr<<"You dont have enough SP!"


mob
verb
Fire_ball()
Fireball()


Problem description:
when ever i try to shoot it the fireball stays under me and it says



runtime error: bad arg name 'Mdir'
proc name: New (/obj/Spell_Items/Fireball/New)
usr: Tony (/mob)
src: Fireball (/obj/Spell_Items/Fireball)
call stack:
Fireball (/obj/Spell_Items/Fireball): New( (8,14,1) (/turf/Grass), null)
Tony (/mob): Fireball()
Tony (/mob): Fire ball()


Uh how about you just use walk() for moving it, and have it walk in the usr's direction. Look up walk().
I noticed this line:

new /obj/Spell_Items/Fireball(usr.loc,Mdir = usr.dir)


Thats obviously causing the problem, though the problem is with your New() proc there.

Mdir has to be defined in the brackets of New(), not as an actual variable, for your current setup to work. What Pyro said about Walk() as well.