1 | script.Parent.MouseButton 1 Click:connect( function () |
2 | local Player = script.Parent.Parent.Parent.Parent.Parent |
3 | local g = Player.Character |
4 | local leg = g:FindFirstChild( 'Right Leg' ) |
5 | leg:Destroy() |
6 | end ) |
This is in a Gui called Riddle and in a GUI called Riddles and in StarterGui I am trying to make it so when clicked it takes off the left leg. For some reason it is not working at all please help
Hi there!
1 | script.Parent.MouseButton 1 Down:connect(function() |
2 | local Player = script.Parent.Parent.Parent.Parent.Parent |
3 | local darm = Player.Character:FindFirstChild( 'Left Leg' ) |
4 | darm:Destroy() --You should use the :Destroy() instead of :remove(). Remove is disambiguate. |
5 | ** end ** |
You're using an anonymous function and haven't closed the end properly, you should close it like end) instead of end.
http://wiki.roblox.com/index.php?title=Anonymous_function
Hope this helped!