Hello, im making a fighting game with projectiles. So far everything was going good but i ran into an issue, the name finder works however it doesnt damage other players, any help would be appreciated, one more thing there are no errors in output script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if hit.Parent.Name == script.Parent.Parent.AtkOwner.Value then print("Name finder works") end else if hit.Parent:FindFirstChild("Humanoid") then hit.Parent:FindFirstChild("Humanoid"):TakeDamage "5" end end end)
✓ ANSWER ACCEPTED
The damage part of my script isnt working, even though there are no errors how do i fix this?
1 answer
✓ Accepted answer
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name == script.Parent.Parent.AtkOwner.Value then
print("Name finder works")
end
else -- ur saying that you want to damage when its not a player
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent:FindFirstChild("Humanoid"):TakeDamage"5"
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
