I want this to be fixed but I can't seem to figure it out. I tried getting rid of debounce but then my script runs forever and I don't need that..
wait(3)
debounce = false
Water = game.Workspace.Ocean2
Char = script.Parent.Parent
function onTouch()
if debounce == false then
Foam = Instance.new("Part")
Foam.Parent = Char.Character.Torso
Foam.BrickColor = BrickColor.new("Mid gray")
Foam.CFrame = CFrame.new(Char.Character.Torso.Position)
Foam.Anchored = true
Foam.CanCollide = false
Foam.BottomSurface = "Smooth"
Foam.TopSurface = "Smooth"
Foam.Transparency = 0.35
Foam.Size = Vector3.new(6,1,6)
script.Parent.Script.Sound:Play()
wait(1.3)
debounce = true
end
end
Water.Touched:connect(onTouch)
--// Please put your code within code blocks yourself in the future; in the question editor all you have to do is click the blue button and put your code between the lines.
All of that only happens once

2 comments
thanks
No problem, and good luck.