S
Squirtle Plays
Guest
When I attack it triggers this error
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object object3:
illegal access of argument, argument is not provided to script
at gml_Script_PlayerState_Attack_Stab (line 6) - if (sprite_index != argument[0])
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_PlayerState_Attack_Stab (line 6)
called from - gml_Object_object3_Step_0 (line 66) - case PLAYERSTATE.ATTACK_STAB: PlayerState_Attack_Stab(); break;
Here's the code that triggers the script
and here is the script
I tried looking around but nobody else's error applied
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object object3:
illegal access of argument, argument is not provided to script
at gml_Script_PlayerState_Attack_Stab (line 6) - if (sprite_index != argument[0])
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_PlayerState_Attack_Stab (line 6)
called from - gml_Object_object3_Step_0 (line 66) - case PLAYERSTATE.ATTACK_STAB: PlayerState_Attack_Stab(); break;
Here's the code that triggers the script
GML:
switch (state)
{
case PLAYERSTATE.FREE: PlayerState_Free() break;
case PLAYERSTATE.ATTACK_STAB: PlayerState_Attack_Stab() break;
}
GML:
hspeed = 0;
vspeed = 0;
//Start of the attack
hitByAttack = ds_list_create();
if (sprite_index != argument[0])
{
sprite_index = argument[0]
image_index = 0;
ds_list_clear(hitByAttack);
}
//Use attack hitbox & check for hits
mask_index = argument[1];
var hitByAttackNow = ds_list_create()
var hits = instance_place_list(x,y,o_yeah,hitByAttackNow,false);
if (hits > 0)
{
for (var i = 0; i < hits; i++)
{
//if this instance has not yet been hit by this attack, hit it
var hitID = hitByAttackNow[| i]
if (ds_list_find_index(hitByAttack,hitID) == -1)
{
ds_list_add(hitByAttack,hitID);
with (hitID)
{
EnemyHit(2);
}
}
}
}
ds_list_destroy(hitByAttackNow);
mask_index = sprite01;
if (Animation_End())
{
sprite_index = sprite01;
state = PLAYERSTATE.FREE;
}