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

Door opening onclick script not working? Not sure why.

I have a door opening script and it's not working.

Script:

dooropen = script.Parent.Opened
doorclose = script.Parent.Closed

doorclose.Click:connect(function()
	doorclose.CanCollide = false
	doorclose.Transparency = 1
	dooropen.CanCollide = true
	dooropen.Transparency = 0
	wait(5)
	doorclose.CanCollide = true
	doorclose.Transparency = 0
	dooropen.CanCollide =false
	dooropen.Transparency = 1
end)

Thank you in advance.

3 comments

0

Where are the scripts located?

0

Where are the scripts located?

1

inside a model that has a dooropen and doorclose.

1 answer

✓ Accepted answer

You need a click detector in doorclose. Also do this:

dooropen = script.Parent.Opened
doorclose = script.Parent.Closed

doorclose.ClickDetector.MouseClick:connect(function()
    doorclose.CanCollide = false
    doorclose.Transparency = 1
    dooropen.CanCollide = true
    dooropen.Transparency = 0
    wait(5)
    doorclose.CanCollide = true
    doorclose.Transparency = 0
    dooropen.CanCollide =false
    dooropen.Transparency = 1
end)

2 comments

2

Thank you!

2

np

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