How to remove a gui at a certain time

I know this is a dumb question but, I have a gui part that is a touch to open . I’m using it for a horror game and when the player steps on the part a gui appears. The thing is that I’ve tried to add a script that makes the gui disappear but the thing is every time I’ve tried the gui would disappear prior to me touching the part, so when I touch the part it does not show the gui.

Can you please show us your script so we can get a better understanding?

wait never mind I’ve actually figured out what was wrong with the script