So uhmmm the title speaks for itself. What am I doing wrong?
Tool = script.Parent Humanoid.WalkSpeed = (16 * 2) --- changes the player speed or velocity Sounds.Unsheath:Play() ToolEquipped = true end function Unequipped() if CheckIfAlive() then Humanoid.WalkSpeed = 16 end ToolEquipped = false end
Tool.Equipped will listen for when said tool is equipped. Tool.Unequipped will do the same for unequipped. And you'd also need to specify the humanoid as well. Here's a very basic sample script:
Tool.Equipped:Connect(function() --Will listen for when the player equips the tool then connects to the enclosed function local char = Tool.Parent --When a tool is equipped it moves from the backpack to the character model char.Humanoid.WalkSpeed = 32 --Sets the walkspeed by finding the humanoid that's under the character end)
Scripts are not inherently smart and thus, you will need to feed them all the information that they actually need and tell them when and what to listen for.