Hello!
Before you say stuff like ‘omg noob u cant script for [Insert Rude word here]’.
Im absolutly not a good scripter.
This script has a lots off error.
if Input.H
do Siren.Mute=false
if Siren.Mute=false
do Siren.Mute=true
if Siren.Mute=true
do Siren.Mute=false
Those who give insults do so with ignorance. They’ve forgotten what it was like to be a beginner. Inputs for keys are as follows: if (Input.GetKey(“H”)){ . I tried that and it doesn’t work but not because of the format but because I haven’t made an “H” input assignment in the input settings.
Hello, sorry for the late message.
I follow evrything you guys said.
But now my oeput says this.
'Exptecting { , found ‘Siren’. In line 3,4
Also here is my updated script.
if (something) {
if (Input.GetKey("H"))
do Siren.Mute=false
if Siren.Mute=false
do Siren.Mute=true
if Siren.Mute=true
do Siren.Mute=false
}
if (Input.GetKeyDown ("H")) { // GetKey returns true as long as the key is down, GetKeyDown returns first frame only
Siren.mute = !Siren.mute; // ! operator returns opposite
}
most of your code doesn’t make sense, seriously, i am not trying to be rude or anything, but look at your logic:
If you press H you unmute your siren, afterwards you check if it has been unmuted to mute it back, and since that was not enough you check again if you just mute the damn siren, to unmute it AGAIN!!!
:)) funny code is funny.
Explain what are you trying to do, i might be of help.