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

I somehow managed to break a door, how do I fix it?

Asked by 9 years ago

This worked fine previously. I just duplicated the door and moved it a bit. And now, it doesn't work anymore. It is supposed to remove the click function of a door so it is not openable anymore What did I do that broke it?

function onClicked()
script.Parent.Parent.Lock2.SurfaceGui.TextBox.Visible = false
script.Parent.Parent.Lock2.ClickDetector.MaxActivationDistance = 0

script.Parent.Parent.Unlock2.SurfaceGui.TextBox.Visible = true
script.Parent.Parent.Unlock2.ClickDetector.MaxActivationDistance = 8

script.Parent.Parent.Light.BrickColor = BrickColor.new("Bright red")


script.Parent.Parent.Union.ClickDetector.MaxActivationDistance = 0
script.Parent.Parent.Union2.ClickDetector.MaxActivationDistance = 0
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
0
Anything said in the output, as long as your hierarchy is correct, this should work BSIncorporated 640 — 9y
0
What do you mean by hierarchy? I scripted this some time ago and I can't really remember stuff anymore :l Wollfram 0 — 9y
0
Did you turn on FilteringEnabled on your game? ClickDetectors do not work the same way when FilteringEnabled is on. You need to capture the click on the client and use a RemoteEvent or RemoteFunction to handle the click on the server. AxeOfMen 434 — 9y

Answer this question