So, basically what I am trying to do is make a dash in the game, but I keep getting this error near the start of my script, at precisely line 6.
here is the error:
Code: Select all
Script error, "doommod.pk3:zscript.txt" line 7:
Unexpected '{'
Expecting '=' or '*=' or '/=' or '%=' or '+=' or '-=' or '<<=' or '>>=' or '&=' or '|=' or '^=' or '>>>=' or '?' or '||' or '&&' or '==' or '!=' or '~==' or '<' or '>' or '<=' or '>=' or '<>=' or 'is' or '..' or '|' or '^' or '&' or '<<' or '>>' or '>>>' or '-' or '+' or '*' or '/' or '%' or 'cross' or 'dot' or '**' or '::' or ')'
Code: Select all
class newplayer1 : doomplayer
{
void dash()
{
If(GetPlayerInput(MODINPUT_BUTTONS)&BT_SPEED
{
A_playsound("skeleton/swing")
A_ChangeFlag(nogravity,true)
A_ChangeVelocity(0,0,0,CVF_RELATIVE|CVF_REPLACE)
A_Setspeed(0.5)
25 ThrustThing(angle * 256 / 360, 20, 0, 0)
A_ChangeVelocity(0,0,0,CVF_RELATIVE|CVF_REPLACE)
A_ChangeFlag(nogravity,false)
A_Setspeed(1)
}
else
{
}
}
}
}
Theory 1 was that I had to remove the If and Else parts, but when I tried that, it still gave me the same error.
I then tried to remove the excess braces, but when I tried that, it still gave me the same error.
Lastly, I remembered that it said there was an unexpected opening brace, and to replace it with one of the many symbols on screen, but I wasn't sure which one I was supposed to use.
And that's what brought me here. anyone have any ideas on what my next course of action is? I'm practically stuck on this
