I’m extremely new to scripting and I tried this script that I thought would work. I’m trying to make a door that when you touch it, you can go through it. Does anyone know how to fix it up?
You are not using the .Touched event correctly. Due to it being an event, it is not an if statement. The humanoid variable is also defined incorrectly.
However, you’ve got the properties of the part correct, good job on that!
In order to use a .Touched event, you will need to write what part will be touched. I am assuming that this script is running in workspace, judging by the “workspace.Part”. So for this, I will be using “workspace.Part”:
workspace.Part.Touched:Connect(function()
In order to make this easier, if all parts in workspace have the same name as “Part”, you can also place a script in the part you want the touched event on and use script.Parent. script means that exact script you are currently writing on, and Parent means what the script is under.
You will now place your code that changes the properties of the instance inside the touched event, so: