No joke. I wish I could record it and put it on YouTube for you guys, it's a truly grand moment.
But with all seriousness. I coded the script to get stuck and play a sound. But when I did my test run the first time I had forgotten to clarify my alState. Fixed that problem. Second test run, when I twist it to the right side it:
1. Makes the wrong sound (broken glass instead of metal clunk)
2. The valve begins to continuously spin at a fast speed, and there was no stopping it.
I don't know what I did, but I might keep that effect. But Just in-case I change my mind I would like the solution to both of these problems. Here is my .hps script so you can see.
////////////////////////////
// Run first time starting map
void OnStart()
{
//Valves
SetEntityConnectionStateChangeCallback("valve_iron_1", "Unlock1");
SetEntityConnectionStateChangeCallback("valve_iron_2", "Unlock2");
SetEntityConnectionStateChangeCallback("valve_iron_3", "Unlock3");
}
void Unlock1(string &in asEntity, int level_state)
{
if (level_state == 1)
{
PlaySoundAtEntity("", "07_pick_lock.snt", "Player", 0.0f, false);
SetWheelStuckState(asEntity, 1, true);
}
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
Thanks for your support guys.
[EDIT]
I really need the help with changing the sounds people.