RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a script where when you click my part called Door1 it will function as a door"
-- local script local door = game.Workspace.Door1 local clickDetector = Instance.new("ClickDetector") clickDetector.Parent = door local isOpen = false local function toggleDoor() if isOpen then isOpen = false door.Orientation = door.Orientation + Vector3.new(0, 90, 0) else isOpen = true door.Orientation = door.Orientation - Vector3.new(0, 90, 0) end end clickDetector.MouseClick:Connect(toggleDoor)