Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my Click Open Door not Functional?

Asked by
SirPaco 66
9 years ago

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

Log in to vote
1
Answered by 9 years ago

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.

0
CanColide is still enabled. Transparency is working though. SirPaco 66 — 9y
0
Yes, it appears i miss-spelled CanCollide. Try it again, with this updated post. CodingEvolution 490 — 9y
0
Alright thank you. SirPaco 66 — 9y
Ad

Answer this question