[Solved] Why doesnt my click detector detect clicks?
Asked by
5 years ago Edited 4 years ago
Im trying to make a thing where theres an "elevator" and when i click a button it should change some stuff but for some reason it doesnt detect the click.Im really new to coding on roblox and any help is appreciated. Thank you!
Explorer:
https://imgur.com/a/bdUan4u
Code:
01 | local text = script.Parent |
02 | local button = text.Parent.Parent.Button |
03 | local detector = button.ClickDetector |
04 | local floor = text.Floor.Value |
10 | function startElevator() |
11 | print ( "elevator started" ) |
31 | function onMouseClick() |
43 | floor = text.Floor.Value |
47 | detector.MouseClick:connect(onMouseClick) |