UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Bad syntax error \"{\"

broken avatar :(
Created 7 years ago
by ERAWEX
0 Members and 1 Guest are viewing this topic.
1,544 views
broken avatar :(
×
broken avatar :(
Location: ch
Date Registered: 28 March 2017
Last active: 1 year ago
Posts
51
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
ERAWEX's Groups
ERAWEX's Contact & Social Links
Hi everyone,

I have used a script from a youtube tut. everything was fine until the bad syntax error poped up. I checked the script and I cannot find the error. Could anyone help?

The error reads: "Bad Syntax {" that's it.

This is the script that I placed in the MAPNAME.gsc:

Code Snippet
Plaintext
radio1()
{
radio = getEnt("radio1", "targetname"); //this is the radio model that the sound will come from
radio_trigger = getEnt("radio1_trigger", "targetname"); //the trigger that you will use to start the sound

radio_trigger setCursorHint("HINT_NOICON");
    radio_trigger UseTriggerRequireLookAt();
    radio_trigger setHintString("Press &&1 to activate radio"); //remove this if you don't want a hintstring

for(;;)
{
radio_trigger waittill("trigger");

if( level.radio_playing == 0 )
{
level.radio_playing = 1;
radio_trigger disable_trigger();

radio playsound("radio1");

wait 366; //change this to the length of your sound

radio_trigger enable_trigger();
level.radio_playing = 0;
}

if( level.radio_playing == 1 )
{
iprintln("Please wait until other radios have finished playing");
wait 5;
}
}
}
radio2()
{
radio = getEnt("radio2", "targetname"); //this is the radio model that the sound will come from
radio_trigger = getEnt("radio2_trigger", "targetname"); //the trigger that you will use to start the sound

radio_trigger setCursorHint("HINT_NOICON");
    radio_trigger UseTriggerRequireLookAt();
    radio_trigger setHintString("Press &&1 to activate radio"); //remove this if you don't want a hintstring

for(;;)
{
radio_trigger waittill("trigger");

if( level.radio_playing == 0 )
{
level.radio_playing = 1;
radio_trigger disable_trigger();

radio playsound("radio2");

wait 10; //change this to the length of your sound

radio_trigger enable_trigger();
level.radio_playing = 0;
}

if( level.radio_playing == 1 )
{
iprintln("Please wait until other radios have finished playing");
wait 5;
}
}
}
Last Edit: May 08, 2017, 05:02:06 am by Sidzzz
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 4 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
You're in the BO3 scripting area, but this script isn't for BO3. Are you in the wrong area, or do you have the wrong script or something else?

And this tut is awful btw, repeating the same code for a different string. You are only showing two parts, there should also have been a part that called radio1 and radio2. Maybe post your entire script? Also, it typically gives a line number? Could you screen shot the error?
Last Edit: May 08, 2017, 10:16:12 pm by MakeCents

 
Loading ...