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
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
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
CanColide is still enabled. Transparency is working though.
Yes, it appears i miss-spelled CanCollide. Try it again, with this updated post.
Alright thank you.