Frictional Games Forum

Full Version: Script problem. ( Unexpected End of File)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been testing out switch case Statements to make random scares.
I've used this tutorial:

And I get a Unexpected End of File error. (Yes I know I haven't put anything in the cases.)
void OnStart()
AddEntityCollideCallback("Player", "ScriptArea_1", "Scare", true, 1);

void PlrCollideSwitch(string &in asParent, string &in asChild, int alState)
    int x = RandInt(1, 5)
    case 1:
        //Scare 1
    case 2:
        //Scare 2
    case 3:
        //Scare 3
    case 4:
        //Scare 4
    case 5:
        //Scare 5
You are missing a bracket. Be careful with those. Add another closing on at the end, because as it is, it only closes the switch, not the function it is within. This is why indentation is good.
Oooooh, That's so silly! I knew that! I was like: 3 brackets? I even tried to put them, but I did that in the wrong place! Thanks, Mudbill you're great!