usr.freezem = 1 //keeps user from moving,
var/obj/Earth_Dragon/Head/H = new()
H.loc = get_step(usr,usr.dir) //putting it where I want,
H.dir = usr.dir //face same direction.
spawn(8) //wait for the animation to finish
usr.freezem = 0 //allow user to move while the attack finishes.
spawn()
var/C = 5 //fire 5 times
while(C)
sleep(rand(2,9))
var/obj/jutsu/Earth/Earth_Dragon/Spikes/S = new() //Creating the spikes to fire,
S.caster = usr
C --
S.loc = get_step(H,H.dir)
world <<"boom"
if(!C)
del(H)
Problem description:
I'ce come to the forums in order to ask for a favor. As it seems, the code above is not working. What it is supposed to do, is create a sort of Dragon made of earth, that appears infront of the user. Then it's supposed to shoot 5 spikes in that direction. After the dragon is created, and placed, the user is allowed to move around. How ever, there seems to be a problem, as when I test the code, the game crashes, and refuses to respond. From what I could tell, the dragon is created, and placed in the correct location. How ever, what seems to be killing the game is the spikes. I would like advise from the community to assist me in this code.
Please help, and Thank you in advance.