Why will this sword not detect when it is being touched?
I am scripting a sword and trying to make it function. One of the obvious functions is that a player will take damage when touched by the sword. I have a local script inside the handle of tool and it is supposed to detect when it is touched, it isn't.
Script:
1 | script.Parent.Touched:Connect( function (hit) |
2 | if hit.Parent = = not game.Players.LocalPlayer.Character then |
4 | game.ReplicatedStorage.RemoteEvents.TakeDamage:FireServer(hit.Parent:FindFirstChild( "Humanoid" ), 20 ) |