Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why it works for 2 times and then it stops working?

Asked by 5 years ago
Edited 5 years ago
local v = game.Workspace.AV
script.Parent.Touched:Connect(function()
wait() 
    if v.Value ~= 1 then
 v.Value = 1
     end
end)

That's the script, the value "v" is being changed by another script.

1
This isn't a loop? This checks if the value isn't 1 then it's going to change it to 1 when the part is touched. Include the other script or elaborate what you want it to do. xPolarium 1388 — 5y
0
You should use "if v.Value =< 1 then". It should work I think. XviperIink 428 — 5y
0
Oh my bad, this works when I touch it an object it changes the value, it works for the first 2 times and then it stops working but prints after “if v.Value ~= 1 then”. carlito1236 24 — 5y

Answer this question