Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

The damage part of my script isnt working, even though there are no errors how do i fix this?

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)

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.