So I scripted a tool that should make the player sprint once it is selected, and return the walkspeed back to normal once it is deselected. The player does sprint once they select the tool, but the problem is that when the player deselects the tool, the walkspeed doesn't return back to normal, and the sprinting continues... and I'm clueless as to why the deselect function isn't working. Any help would be appreciated. Thanks! (The script is below)
function onSelected(onSelected)
script.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 100
end
function onDeselected(onDeselected)
script.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16
end
script.Parent.Selected:connect(onSelected)
script.Parent.Deselected:connect(onDeselected)

3 comments
This is the answer right there.
I tried replacing this in the old script but it still didn't work (function Equipped() script.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 100 end function Unequipped() script.Parent.Parent.Parent.Character.Humanoid.WalkSpeed = 16 end script.Parent.Equipped:connect() script.Parent.Unequipped:connect())
I've updated my post accordingly to fit your requirements.