I am new at scripting to so I decided I would try to make a code where when you touch part, it's collide is false for 3 seconds then returns to normal. Also when the brick is in "Can't collide" the color of part2 changes as well. So can anyone point out the error?
Base = Script.Parent.Parent.Part
Colors = game.Workspace.Part2
function onTouched (hit)
Base.Transparency = 1
Base.CanCollide = false
wait(3)
Base.Transparency = 0.3
Base.CanCollide = true
end
Script.Parent.Touched:connect(onTouched)
if Base.CanCollide = false then
Colors.BrickColor = Brightgreen
end
if Base.CanCollide = true then
Colors.BrickColor = Brightred
end

1 comment
If I solved your problem I would appreciate if you could accept my answer.