Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is my Click Open Door not Functional?

I attempted to create a click open door with a ClickDetector but it is not working. I need information on how to fix this. My Script is below.

function onClicked()
script.Parent.Door.Transparency = 1
script.Parent.Door.CanCollide = false
end

1 answer

✓ Accepted answer

Your function isn't connected to any event, or being called. Try connecting this function to the "MouseClick" event in the ClickDetector. I also suggest you use a variable to represent the value of the script's parent, to make it shorter and neater.

local Door = script.Parent
local Click = Door.ClickDetector -- Let's assume the click detector is in the door part.

local function OpenDoor()
	Door.Transparency = 1
	Door.CanCollide = false
end

Click.MouseClick:connect(OpenDoor)

Let me know if you have any questions.

3 comments

0

CanColide is still enabled. Transparency is working though.

0

Yes, it appears i miss-spelled CanCollide. Try it again, with this updated post.

0

Alright thank you.

This discussion is preserved as it was. New answers, comments, and votes are closed.