Hi!
I made this ProxPront interaction script. It works for the first time, then turns off again, then breaks.
What’s wrong?
while wait() do
wait()
workspace.City.Cafe.Cafe.Sink1.FossitPart.ParticleEmitter.Enabled = false
workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.Triggered:Connect(function(player)
--- turn on
if workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.ActionText == "Turn on Fossit" then
wait()
print("Someone has turned on the fossit.")
workspace.City.Cafe.Cafe.Sink1.FossitPart.ParticleEmitter.Enabled = true
workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.ActionText = "Turn Off Fossit"
wait()
---turn off
elseif workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.ActionText == "Turn Off Fossit" then
wait()
print("Someone has turned off the fossit.")
workspace.City.Cafe.Cafe.Sink1.FossitPart.ParticleEmitter.Enabled = false
workspace.City.Cafe.Cafe.Sink1.ProxPart.ProximityPrompt.ActionText = "Turn On Fossit"
wait()
end
end)
workspace.City.Cafe.Cafe.Sink2.FossitPart.ParticleEmitter.Enabled = false
workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.Triggered:Connect(function(player)
--- turn on
if workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.ActionText == "Turn on Fossit" then
wait()
print("Someone has turned on the fossit.")
workspace.City.Cafe.Cafe.Sink2.FossitPart.ParticleEmitter.Enabled = true
workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.ActionText = "Turn Off Fossit"
wait()
---turn off
elseif workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.ActionText == "Turn Off Fossit" then
wait()
print("Someone has turned off the fossit.")
workspace.City.Cafe.Cafe.Sink2.FossitPart.ParticleEmitter.Enabled = false
workspace.City.Cafe.Cafe.Sink2.ProxPart.ProximityPrompt.ActionText = "Turn On Fossit"
wait()
end
end)
end
