Touched Event activated when certain part touches

Hello! I’m struggling with this, I’m very new to scripting so please bear with me.

This is my code
unknown

It’s a local script placed in ServerScriptService, would I need to move it into the door part? I’ve tried changing part.Name into part.Parent but it makes no difference.

local scripts cant work on ServerScriptService

change it to a script

then change

if part.Name == key1 then

to

if part == key1 then

Hi, assuming your key has a handle, this script should work:

local door = game.Workspace.Door

door.Touched:Connect(function(part)
	if part.Parent.Name == "key" then
        door.CanCollide = false
		door.Transparency = 0.5
	end
end)

However, if you want the door opening to be local (client sided), let me know, I’ll also be able to help with that! Let me know how it goes. If this doesn’t work, then please show me the structure of the “key” tool in your explorer.

This worked, thank you for your help!