I'm not really good in CFrame so can you help me for fix this?:/
15:25:48.386 - Workspace.Gate.Script:8: bad argument #2 to '?' (Vector3 expected, got CFrame)
deboulse = false
script.Parent.Button.ClickDetector.MouseClick:connect(function(player)
if deboulse == false then
deboulse = 2
print(player.Name.." open door")
for index, door in pairs(script.Parent.Parts:GetChildren()) do
for i = 0,100 do
door.CFrame = door.CFrame-CFrame.new(0,0,-4)
wait()
end
end
for index, light in pairs(script.Parent.lights:GetChildren()) do
light.Color = BrickColor.new("Really red")
end
script.Parent.lights.BrickColor = BrickColor.new("Really red")
deboulse = true
elseif deboulse == true then
deboulse = 2
print(player.Name.." close door")
for index, door in pairs(script.Parent.Parts:GetChildren()) do
for i = 0,100 do
door.CFrame = door.CFrame-CFrame.new(0,0,4)
wait()
end
end
for index, light in pairs(script.Parent.lights:GetChildren()) do
light.Color = BrickColor.new("Institutional white")
end
script.Parent.lights.BrickColor = BrickColor.new("Institutional white")
deboulse = false
end
end)
Explorer: https://gyazo.com/ebc068f3ba1378368b4869dab81c79a6

2 comments
Thanks you but now the door rotate? Why? https://gyazo.com/dcd7ffa122f8fe66914329f78b551aa1
It shouldn't rotate from this change, there must be some other problem. You'll have to post update code in a new question.