killing/levels

hello, I am trying to write a script to;

change level, when I enter in a temple, but I need to kill all the turrets in the way,
if I don’t kill, the temple don’t works.
which script should I use or how I write in he?

and I try to make the script, it is right?
what have I done wrong?

function Update () {

	if(hit : gameObject.tag == "Worm")Application.LoadLevel ("Worm_World_Map_1");
	
}

this error appear;

Assets/Scripts/Control Scripts/TempleLoadLevel.js(4,42): BCE0043: Unexpected token: ).

Assets/Scripts/Control Scripts/TempleLoadLevel.js(4,16): BCE0044: expecting ), found ‘:’.

You can’t just copy-paste a line of code and expect it to work.
What are you doing wrong?
There’s no such variable as “hit” as far as I can see.
Since this line appears to be copy-pasted from another tutorial you probably don’t have a level named “Worm_World_Map_1” either. Is there an object which has the “Worm” tag? Is the “Worm” tag declared?

I’m going to repeat my statement from another of your threads: Start by learning basic programming before you jump right into a high-quality 3D game engine.
You need to understand the code you’re handling to make things work.

hey, I am not copying, I did this script, and YES I have this map and a tag called Worm in my player.

try this

function Update () {

	if (hit)  gameObject.tag == "Worm"
                      Application.LoadLevel ("Worm_World_Map_1");
	
}

it may or may not work it a wild gess from the your errors

try this with a active trigger

Application.LoadLevel (0);

thanks

the error was

Assets/Scripts/Control Scripts/TempleLoadLevel.js(4,41): UCE0001: ‘;’ expected. Insert a semicolon at the end.

What’s ‘hit’? The last object you killed?

if (hit.gameObject.tag == “worm”) Application.LoadLevel(“yourLevelName”)

A boolean value?

if (hit gameObject.tag == “worm”) Application.LoadLevel(“yourLevelName”)

Are you trying “hit” to be a function or detection?
It’s hard to know what’s going on in your code, but these might fix the sintax errors you’re getting.