script.Parent.MouseButton1Click:connect(function() local Player = script.Parent.Parent.Parent.Parent.Parent local g = Player.Character local leg = g:FindFirstChild('Right Leg') leg:Destroy() 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!
script.Parent.MouseButton1Down:connect(fÂunction() local Player = script.Parent.Parent.Parent.Parent.Parent local darm = Player.Character:FindFirstChild('Left Leg') darm:Destroy() --You should use the :Destroy() instead of :remove(). Remove is disambiguate. **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!