handle.Touched:connect(function(hit)
if Mouse.Button1Down then
while true do
wait(0.1)
if hit.Parent:WaitForChild("Humanoid",1) then
hit.Parent:WaitForChild("Humanoid",1):TakeDamage(100)
print("Success!")
else
print("Something happened.")
end
end
end
end)
The script keeps saying that "Humanoid" is a nil value, even though it exists in the target. What do I do to fix this?

5 comments
what is that mouse.button1down for?
dont think those can be used in serverscripts?
this is a LocalScript?
Yes, this is a LocalScript. It's a script for a sword.
You need to put this in a server script due to Filtering Enabled, I think.