I am following the cookbook to scripting on the ROBLOX wikia. And I'm on chapter 5 at the beginning where you make a hopperbin that resets your character once you left click.. I can't seem to get it to do that.
I have a tool that is in StarterPack and the localscript is inside the tool.
This is the code:
script.Parent.Selected:connect(function(m) m.Button1Down:connect(function() if game.Players.LocalPlayer.Character then game.Players.LocalPlayer.Character:BreakJoints() end end) end)
This is the error: Selected is not a valid member of tool.
Your problem is that Selected is not an event, however Equipped is. Replace Selected with Equipped, and it should work. However, I believe a more convienient way would be to use the activated event like this:
script.Parent.Activated:connect(function() if game.Players.LocalPlayer.Character then game.Players.LocalPlayer.Character:BreakJoints() end end)
EDIT: Heres the link to the tools page: http://wiki.roblox.com/index.php?title=API:Class/Tool