Tool.Equipped not working

im a beginner at scripting im having some trouble with tool.equipped. im trying to make a script where if they have a specific tool equipped then they can press R and it prints but if tool is not equipped then pressing R does nothing.

here is the script(i got rid of the stuff ive done with tool.equipped)

local replicatedStorage = game.ReplicatedStorage
local fireBlast = replicatedStorage.fireBlast

local function onKeyPress(input)
	
local direction = workspace.CurrentCamera.CFrame.LookVector
	if input.KeyCode == Enum.KeyCode.R then
			
	
			if isplaying == false then
			isplaying = true
			animplay:Play()
			animplay.Stopped:Connect(function()
				isplaying = false
				
				
			end)
		fireBlast:FireServer(direction)
			end
		end
	 end
	

		userInputService.InputBegan:Connect(onKeyPress)

	

I found a tutorial in the Creator Documentation that seems to have exactly what you’re looking to do.

i get an error that says Equip is not a valid member of Part "Workspace.shockaloc.ClassicSword.Handle

That means its trying to find something named Equip in Handle but it cant
Either remove the line or add in what it was supposed to be