Troubles with scripting a script that deals with "wait" and "can collide"

Hello, developer forum. I have a problem. ;-; To be specific, I have a scripting problem. note: I don’t script often, I apologize if this post is dumb.
I want to achieve a system where somebody can walk through a brick after a certain amount of time, and after a certain amount of time, they can’t go through it again.
However, I have no idea how. There aren’t any free model scripts (that I could find) that have similar code, or what I am looking for, I can’t find anything that useful on the developer forum, and I’m having a hard time understanding the Developer Hub, too.
I had tried 2 different scripts.

wait(3)
cancollide(true)
wait (3)
cancollide(false)
end

the one above is the latest try.

wait(3)
	parent.Part.cancollide = true
wait(3)
parent.part.cancollide = false
end

the one above is my try.

you don’t need to fix both scripts, just one. ^-^

Sorry if this is the wrong category. ;~;

local part = script.Parent
part.CanCollide = false
wait(3) -- here put number of seconds you want to wait
part.CanCollide = true
1 Like

Any errors?

I belive that it has to be “.CanCollide”, not “.cancollide”. It may or may not be case-sensitive in this way.

Try this:

local part = -- path to part here (EX: game.Workspace.yourPart)

part.CanCollide = false
wait(3)
part.CanCollide = true
wait(3)
part.CanCollide = false
1 Like

I already got it working now, but thanks. ^-^

Oh okay, how’d you end up doing it? And, do you need help with anything else related to it? I’m open to helping out more.

1 Like

I ended up using DecodedMint’s strategy, and I don’t need any more help, thanks for offering to help, though. :smile:

Alrighty, you have a good week! Hit me up if you do in the future though, cya!

1 Like

Thank you, have a good week too! ^w^