I'm unsure on how to fix this code and why it wont work. Can someone hint me in the right direction?
1 | function Click() |
2 | script.Parent.Position = Vector 3. FromAxis( 17.142 , 26.116 ,- 263.459 ) |
3 | end |
4 |
5 | game.Workspace.restraint 1. ClickDetector.mouseClick:connect(Click) |
Simple change:
1 | local clicker = script.Parent |
2 | local part = script.Parent.Parent |
3 |
4 | clicker.mouseClick:connect( function () |
5 | part.Position = Vector 3. new( 0 , 0 , 0 ) --change to position you want |
6 | end ) |
make sure this is a script inside click detector and make sure the click detector is in a part.
so the order will be part's children is click detector, click detector children is script
Please accept answer and upvote if helped!