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

Why isn't this button door script working?

I have a door and two buttons. One button is supposed to make the door transparent, one button is supposed to return it back to its opaque state. Whenever I click one of the buttons, nothing pops up in the output.

Close button:

function onClicked()
	
Script.Parent.Parent.Door.Transparency = 0
Script.Parent.Parent.Door.CanCollide = true

end

Script.Parent.ClickDetector.MouseClick:connect(onClicked)`

Open button:

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

end

Script.Parent.ClickDetector.MouseClick:connect(onClicked)

Setup: http://i.imgur.com/0Cy2ROJ.png

1 answer

The "s" in "Script.Parent" is supposed to be lowercased

function onClicked()

script.Parent.Parent.Door.Transparency = 0
script.Parent.Parent.Door.CanCollide = true

end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

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