Hello,
Recently I have been trying to make a door which slides up and down when you press a button, I am trying to get it so the script looks for the position of the door and if it is equal to 190.253, 8.125, 67.725, then make the door open by sliding up. But on the 6th line, it comes up with the error of
Workspace.Model.LeftDoor.Button.Script:6: attempt to call global 'Vector3' (a table value)
local LeftDoor = script.Parent.Parent.Parent.LeftOfficeDoor
local RightDoor = script.Parent.Parent.Parent.RightOfficeDoor
local Sound = script.Parent.Sound
script.Parent.ClickDetector.MouseClick:connect (function()
if LeftDoor.CFrame == (Vector3(190.253, 8.125, 67.725)) then
for i = 1,14 do
LeftDoor.CFrame = CFrame.new(LeftDoor.Position + Vector3(0,1,0))
wait()
end
Sound.Playing = false
Sound.Playing = true
else if LeftDoor.Position == (Vector3(190.253, 22.125, 67.725)) then
for i = 1,14 do
LeftDoor.CFrame = CFrame.new(LeftDoor.Position - Vector3(0,1,0))
wait()
end
Sound.Playing = false
Sound.Playing = true
end
end
end)
Does anybody know a way of fixing this?

4 comments
You should do Vector3.new instead of Vector3. Maybe that is your problem...
So I would do something like
if LeftDoor.CFrame == (Vector3.new(190.253, 8.125, 67.725)) then? Because that didn't workuh no, if LeftDoor.CFrame == Vector3.new(--Position--)
I hope it would work