I was watching a YouTube tutorial on sliding doors and copied the uploader's script and altered it slightly.

local tween = game:GetService("TweenService")
local d1 = script.Parent:WaitForChild("Door1")
local d2 = script.Parent:WaitForChild("Door2")
local tweeninfo = TweenInfo.new(
	0.5,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)
local d1Open = (CFrame = CFrame.new(129.5, 5, 194.5))
local d2Open = (CFrame = CFrame.new(104.5, 5, 194.5))
local d1Close = (CFrame = CFrame.new(121.5, 5, 194.5))
local d2Close = (CFrame = CFrame.new(112.5, 5, 194.5))
local tween1Open = tween:Create(d1,tweeninfo,d1Open)
local tween1Close = tween:Create(d1,tweeninfo,d1Close)
local tween2Open = tween:Create(d2,tweeninfo,d2Open)
local tween2Close = tween:Create(d2,tweeninfo,d2Close)

script.Parent.Detector1.Touched:Connect(function(hit)
	tween1Open:Play()
	tween2Open:Play()
	wait()
	tween1Close:Play()
	tween2Close:Play()
end)
script.Parent.Detector2.Touched:Connect(function(hit)
	tween1Open:Play()
	tween2Open:Play()
	wait()
	tween1Close:Play()
	tween2Close:Play()
end)

The problem is in line 12 with the second equal sign. The script analysis window states, "Error:(12,24) Expected ')' (to close '(' at column 16),got '=' " The output states, "Workspace.Sliding Doors.Script:12: ')' expected near '=' "

I just don't get it. The uploader's script had no errors, and all I did was change the names of a few variables. It looks fine to me.

Also, I know the events could use a debounce. No need to tell me about it.

2 comments

0

Strange. Can you show us the video so we can see what you changed?