I am a beginner scripter and I am trying to make a simple open and close door that changes the transparency and cancollide when clicked and changes it back to default when clicked again. I need help on this script
game.Workspace.Part.CanCollide(function(close) close = true end)
local clickdetector = game.Workspace.Part.ClickDetector clickdetector.MouseClick:Connect(function() game.Workspace.Part.Transparency = (0.5) game.Workspace.Part.CanCollide = false close = false end) if close(false) then clickdetector.MouseClick:Connect(function() game.Workspace.Part.Transparency = (0) game.Workspace.Part.CanCollide = true end) end
the scripts error: 20:39:08.891 - Workspace.Part.ClickDetector.Script:1: attempt to call field 'CanCollide' (a boolean value)
if anyone could help me that would be great.
