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:
script.Parent.Touched:Connect(function(hit)
if hit.Parent == not game.Players.LocalPlayer.Character then
print("hit")
game.ReplicatedStorage.RemoteEvents.TakeDamage:FireServer(hit.Parent:FindFirstChild("Humanoid"), 20)
end
end)

2 comments
Mark it as the answer!
It doesn't give me the option