OnHit Function problems and other stuff

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local M1 = ReplicatedStorage.RemoteEvents.Combat.M1
local M1Stop = ReplicatedStorage.RemoteEvents.Combat.M1Stop
local OnHitAnim = ReplicatedStorage.Animations.OnHit
local hitcolor = Color3.new(0.737255, 0, 0)

local function onhit (character)
	local OnHitTrack = character.Humanoid:LoadAnimation(OnHitAnim)
	OnHitTrack:Play(0.1,1,2.25)
	
	for i,characterpart in pairs(character:GetChildren()) do
		if characterpart:IsA("Part") or characterpart:IsA("MeshPart") then
			characterpart.Color = hitcolor
              -- change color back to normal
		end
	end
end


M1.OnServerEvent:Connect(function(player,Damage,AnimationPlaying)
	local fireray = Ray.new(player.Character.HumanoidRootPart.Position,player.Character.HumanoidRootPart.CFrame.LookVector * 3.45)
	local human = player.Character.Humanoid
	local commands = {
		blocking = player.Character.Blocking
	}
	
	local hit,position = game.Workspace:FindPartOnRayWithIgnoreList(fireray,{script.Parent})
	if hit then
		if hit.Name == ("HitBox") then
			print(hit.Name,hit.Parent)
			hit.Parent.Health = hit.Parent.Health - Damage
			onhit(hit.Parent.Parent)
		end
	end
	
	if AnimationPlaying == true then
		for i,command in pairs(commands) do
			command.Disabled = true
		end
	end
end)

M1Stop.OnServerEvent:Connect(function(player,AnimationPlaying)
	local commands = {
		blocking = player.Character.Blocking
	}

	if AnimationPlaying == false then
		for i,command in pairs(commands) do
			command.Disabled = false
		end
	end
end)

https://gyazo.com/9ff8e1a56e78b8d86382fd444d42bc97

So my problems are:

  1. Idk how to really set the characters skin color back to normal after it changes red to indicate that it got hit maybe i store the characters normal color in a table or smth but idk

  2. if possible how would i make a small overlay of the skin and make it red instead of making the character skin red because in the gyazo clip the clothing dosnt change colors

  3. any good hit sounds because im to poor for 20 robux

You could add a value to the player and store that temporarily stores the Color3 value of the hit limb.

For sounds, use the Audio section of the toolbox to search for random oof, thud, thump or whatever noises. Once searched, Click the filter/slider menu and reduce the time to less than 3 seconds to filter out the stranger stuff that people upload.

For changing the clothing color to red:

i dont think i see any clothings under character

i searched in the toolbox and after like 10 mins i finally found a good sound effect thanks

You said this, so I thought you needed help with clothing too.

yk any alternatives that would work other then changes all of the players clothes to 1 color