How do i make it, so ProcessReceipt shout out Buyer Username?

productFunctions[1339707522] = function(receipt, player)
	for i, player in ipairs(game.Players:GetPlayers()) do
		if player.Character then
			local hum = player.Character:FindFirstChild('Humanoid')
			if hum then
				hum.Health = 0
				KillMessage:FireAllClients(player) -- shouts out buyers username in chat "someone bought kill everyone!", but in this case, it shouts out everyones usernames in chat.
			end 
		end
	end
		return true
end

it shouts out EVERYONES username in the server.

This is not very clear on what you are trying to achieve here.

What are you trying to script and what should trigger it?

that part of the code isn’t the issue show us your onclientevent for the killmessage

local KillMessage = game.ReplicatedStorage:WaitForChild("KillMessage")
debounce = false

KillMessage.OnClientEvent:Connect(function(Player)
	if debounce == false then
		debounce = true
		game.StarterGui:SetCore("ChatMakeSystemMessage", {
			Text = Player.DisplayName.." just killed everyone!"
		})
		debounce = false
	end
end)

for instance, noob475 buys “Kill Everyone” developer product, after that, everyone die in the server, and it should shout out his username in the chat. “noob475 just killed everyone”

productFunctions[1339707522] = function(receipt, player)
	for i, player in ipairs(game.Players:GetPlayers()) do
		if player.Character then
			local hum = player.Character:FindFirstChild('Humanoid')
			if hum then
				hum.Health = 0			
			end 
		end
	end
        KillMessage:FireAllClients(player.DisplayName) 
		return true
end

and

local KillMessage = game.ReplicatedStorage:WaitForChild("KillMessage")
debounce = false

KillMessage.OnClientEvent:Connect(function(PlayerName)
	if debounce == false then
		debounce = true
		game.StarterGui:SetCore("ChatMakeSystemMessage", {
			Text = PlayerName.." just killed everyone!"
		})
		debounce = false
	end
end)

try that let me know if it works
for studying purposes I put the fireallclients outside of the for loop because youre firing it multiple times for no reason

and i sent only the player’s name instead of the instance itself

give it a shot

I think I see the issue here, “player” is defined twice in your Server script and the line that fires the client events is passing along the second player, from the line

	for i, player in ipairs(game.Players:GetPlayers()) do

To fix this simply change the player to anything else, and any lines that reference it.

As @Serrattor also mentioned, move the FireAllClients outside of the loop