So to start off, download this prefab [You are not allowed to view external links.
Register or Login to see them] Place the prefab in root/map_source/_prefabs/ and your ready for radiant.

Radiant: All you need to do is open the prefab by going to misc > prefab and opening the prefab, then stamp the prefab and move the pieces where you want them to be. If your on a tutorial map then delete the other power switch or this wont work.

Script: Navigate over to your mapname.gsc in root/usermaps/mapname/scripts/zm/mapname.gsc (Not the CSC) and open it.

I noticed something in the script: Your functions pick1() and pick2() both thread your build() function, so essentially you have 2 of the same build() functions running in parallel, and build() won't break if you only have 1 part, because the first line wait's until the variable level.allParts equals 2.

Does this explain why some custom maps are playing the power up sound twice for players when you hit the power switch?

The way you have it set up is perfect, but instead of threading build() two times in the pick1() and pick2() functions, just thread build() once before pick1() & pick2() are threaded, and it will only execute once after the variable level.allParts= 2. Then of course remove the "thread build()" line from pick1() and pick2().

Maybe i'm reading it wrong or something, but just thought I would give some potentially helpful feedback. Thanks again, this is very useful.

I noticed something in the script: Your functions pick1() and pick2() both thread your build() function, so essentially you have 2 of the same build() functions running in parallel, and build() won't break if you only have 1 part, because the first line wait's until the variable level.allParts equals 2.

Does this explain why some custom maps are playing the power up sound twice for players when you hit the power switch?

The way you have it set up is perfect, but instead of threading build() two times in the pick1() and pick2() functions, just thread build() once before pick1() & pick2() are threaded, and it will only execute once after the variable level.allParts= 2. Then of course remove the "thread build()" line from pick1() and pick2().

Maybe i'm reading it wrong or something, but just thought I would give some potentially helpful feedback. Thanks again, this is very useful.

You are correct, from what I see there is also no need to use a while loop inside the build function since waittill only needs to be called once and it will continue to wait.

I believe this was the first script he released so its safe to assume that it might have errors.

i put the script into to my gsc and loaded the game after i did everything and i got fatal error "getweapon" with 0 parameters in script at line 306***unresolved external "getweapon" with 0 parameters in scriptand this is what is at line 306, weapon = GetWeapon( PAP_WEAPON_KNUCKLE_CRACK );

i put the script into to my gsc and loaded the game after i did everything and i got fatal error "getweapon" with 0 parameters in script at line 306***unresolved external "getweapon" with 0 parameters in scriptand this is what is at line 306, weapon = GetWeapon( PAP_WEAPON_KNUCKLE_CRACK );

can anyone help?

You're getting an unresolved variable, which probably means the .gsh file in which PAP_WEAPON_KNUCKLE_CRACK is defined isn't getting parsed or included somewhere. Or simply that PAP_WEAPON_KNUCKLE_CRACK isn't defined. In my script I did it differently, like this

You're getting an unresolved variable, which probably means the .gsh file in which PAP_WEAPON_KNUCKLE_CRACK is defined isn't getting parsed or included somewhere. Or simply that PAP_WEAPON_KNUCKLE_CRACK isn't defined. In my script I did it differently, like this