I have a bool value and a script that checks every 1 second if the Bool “tgd/toggled” is enabled.
When it detects that its enabled, the hose and such turns on, however, it won’t detect it turning off, I might be stupid and it might be a really simple fix, so any help is appreciated.
Code:
local tgd = script.Parent.Toggled
local hinges = script.Parent.Parent.HingesOnSprayer
local nzl = script.Parent.Parent.NozzlePart
while true do
if tgd.Value == true then
nzl.Nozzle.Muffled.Enabled = true
nzl.Nozzle.Straight.Enabled = true
while true do
nzl.Nozzle.SplashFX:Emit(25)
hinges.Hit.TargetAngle = -30
nzl.Nozzle.Hit.Playing = true
wait(0.5)
print("Hit")
hinges.Hit.TargetAngle = 15
wait(0.5)
end
else
nzl.Nozzle.Muffled.Enabled = false
nzl.Nozzle.Straight.Enabled = false
nzl.Nozzle.Main.Playing = false
hinges.Hit.TargetAngle = 15
end
print("checked")
wait(1)
end
I am still going to be making a pump with the buttons to enable and disable it, however right now I’m only using the Server sided view to enable and disable it