Hey gamers, I’m trying to create a button that opens two sliding doors when clicked using the tween service. The door itself works fine, however problems have arisen when attempting to activate it through a ClickDetector. I get this error “Connect is not a valid member of ClickDetector” on line 14, and I have zero clue why. I searched online for an answer as well as the developer forums, but in places where I’ve seen it mentioned, it’s either ignored or dismissed. I have no clue what’s causing the problem, or where I would start to attempt to solve it.
Here’s the script that I’m using.
I’m making this in a place separate from anything else, and the error mentioned before is the only error I get.
local TweenService = game:GetService("TweenService")
local Lroot = script.Parent.Parent.LRoot
local Rroot = script.Parent.Parent.RRoot
local PanelSlideInfo = TweenInfo.new()
local PanelSlideTween1 = TweenService:Create(Lroot, PanelSlideInfo, {
CFrame = Lroot.CFrame * CFrame.new(Lroot.Size.X + 0.1, 0, 0)
})
local PanelSlideTween2 = TweenService:Create(Rroot, PanelSlideInfo, {
CFrame = Rroot.CFrame * CFrame.new(Rroot.Size.X + 0.1, 0, 0)
})
script.Parent.MouseClick:Connect(function(player)
PanelSlideTween1:Play()
PanelSlideTween2:Play()
end)