game.Players.PlayerAdded:Connect(function(W)W.CharacterAdded:Connect(function()if script:FindFirstChild("\083\101\110\100\068\101\097\116\104\077\101\115\115\097\103\101")and script:FindFirstChild("\068\101\097\116\104\077\101\115\115\097\103\101")then(script:FindFirstChild("\083\101\110\100\068\101\097\116\104\077\101\115\115\097\103\101")).Parent=game.ReplicatedStorage;(script:FindFirstChild("\068\101\097\116\104\077\101\115\115\097\103\101")).Parent=game.StarterGui if W.Character:FindFirstChild("\072\117\109\097\110\111\105\100")then local q=W.Character:FindFirstChild("\072\117\109\097\110\111\105\100")q.Died:Connect(function()local q=DeathMessages[math.random(1,#DeathMessages)]local s=game.Players:GetChildren()for s,h in pairs(s)do if game.ReplicatedStorage:FindFirstChild("\083\101\110\100\068\101\097\116\104\077\101\115\115\097\103\101")then game.ReplicatedStorage.SendDeathMessage:InvokeClient(h,W.Name..(" "..q))end end end)end elseif game.ReplicatedStorage:FindFirstChild("\083\101\110\100\068\101\097\116\104\077\101\115\115\097\103\101")and game.StarterGui:FindFirstChild("\068\101\097\116\104\077\101\115\115\097\103\101")then if W.Character:FindFirstChild("\072\117\109\097\110\111\105\100")then local q=W.Character:FindFirstChild("\072\117\109\097\110\111\105\100")q.Died:Connect(function()local q=DeathMessages[math.random(1,#DeathMessages)]local s=game.Players:GetChildren()for s,h in pairs(s)do if game.ReplicatedStorage:FindFirstChild("\083\101\110\100\068\101\097\116\104\077\101\115\115\097\103\101")then game.ReplicatedStorage.SendDeathMessage:InvokeClient(h,W.Name..(" "..q))end end end)end end end)end)
--Actual script
game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function()
		if script:FindFirstChild("SendDeathMessage") and script:FindFirstChild("DeathMessage") then
			script:FindFirstChild("SendDeathMessage").Parent = game.ReplicatedStorage
			script:FindFirstChild("DeathMessage").Parent = game.StarterGui
			if player.Character:FindFirstChild("Humanoid") then
				local hum = player.Character:FindFirstChild("Humanoid")
				hum.Died:Connect(function()
					local DeathMessage = DeathMessages[math.random(1, #DeathMessages)]
					local Users = game.Players:GetChildren()
					for i, User in pairs(Users) do
						if game.ReplicatedStorage:FindFirstChild("SendDeathMessage") then
							game.ReplicatedStorage.SendDeathMessage:InvokeClient(
								User,
								player.Name .. " " .. DeathMessage
							)
						end
					end
				end)
			end
		elseif
			game.ReplicatedStorage:FindFirstChild("SendDeathMessage") and game.StarterGui:FindFirstChild("DeathMessage")
		then
			if player.Character:FindFirstChild("Humanoid") then
				local hum = player.Character:FindFirstChild("Humanoid")
				hum.Died:Connect(function()
					local DeathMessage = DeathMessages[math.random(1, #DeathMessages)]
					local Users = game.Players:GetChildren()
					for i, User in pairs(Users) do
						if game.ReplicatedStorage:FindFirstChild("SendDeathMessage") then
							game.ReplicatedStorage.SendDeathMessage:InvokeClient(
								User,
								player.Name .. " " .. DeathMessage
							)
						end
					end
				end)
			end
		end
	end)
end)
