Here's the script :
local v =game.Workspace.AV script.Parent.Touched:Connect(function(part) if v.Value ~= 2 then v.Value = 1 end end)
The script checks if the value is equal to 2 and then it changes it to 1 when the part is touched.
There's another script that changes the value from 1 to 2.
Your script checks whether or not v.Value
is not equal to 2
. You mentioned that you have another script that changes the value from 1
to 2
. Here lies your problem. When the value turns to 2
, the condition v.Value ~= 2
becomes false and there will no way to turn the value back to 1
again (assuming that there are no other scripts involved).
Closed as Non-Descriptive by evaera
This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.
Why was this question closed?