What's wrong with this tweening script?

code:

local ts = game:GetService("TweenService")
local water1 = workspace._Water2
local water2 = workspace._Water1
local ti = TweenInfo.new(20,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out
)
local ti2 = TweenInfo.new(5,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out
)
local tg = {CFrame = water1.CFrame - Vector3.new(0, 15, 0)}
local tg2 = {CFrame = water2.CFrame - Vector3.new(0, 8, 0)}
local tg3 = {CFrame = water1.CFrame + Vector3.new(0, 15, 0)}
local tg4 = {CFrame = water2.CFrame + Vector3.new(0, 8, 0)}
local tc = ts:Create(water1, ti, tg)
local tc2 = ts:Create(water2, ti2, tg2)
local tc3 = ts:Create(water1, ti, tg3)
local tc4 = ts:Create(water1, ti2, tg4)
local debounce = false
local valve = workspace.Valve
valve.ClickDetector.MouseClick:Connect(function()
	if debounce == false then
	debounce = true
	valve.SqueakSound:Play()
		valve.SqueakSound.Played:Connect(function()
			tc:Play()
			tc2:Play()
			tc.Completed:Connect(function()
				task.wait(60)
				tc3:Play()
				tc4:Play()
				debounce = false
			end)
		end)
	end
end)

only the sound plays. i know tweens may stop or not run if there is something in the way. the water is cancollide off and i set collission groups to nil. help.

show the output please!

ignore this trying to get 30 words

I don’t think Played is an event, but I might be wrong. Try valve.SqueakSound.Ended instead.

1 Like

The only issue i have with this, is that its all connected which makes it hard to read.

So for this part which is where i assume the issue is, you might need to add .Ended.

valve.SqueakSound.Ended:Connect(function()
			tc:Play()
			tc2:Play()
			tc.Completed:Connect(function()
				task.wait(60)
				tc3:Play()
				tc4:Play()
				debounce = false
			end)
		end)
	end
end)

After testing, i concluded that this works

This Shouldn’t be the issue as tween is able to do this without physics getting in the way.

1 Like

No error. Seriously. Characters

i said that but it showed an error saying that you cant use those 2 words together. idk