TeamColor for killer and player

Hello so how do I make so that the textColor of the killer is his teamcolor and both as the plr

local killerEvent = game.ReplicatedStorage.KillEvent
local textLabel = script.Parent

killerEvent.OnClientEvent:Connect(function(plr,killername)
	if plr and killername then
		wait(1)
		local newLabel = textLabel:Clone()
		newLabel.Text = killername.." > "..plr.Name
		newLabel.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui").KillFeed.Frame
		wait(1)
		newLabel:Destroy()
	end
end)

Got it!

local killerEvent = game.ReplicatedStorage.KillEvent
local textLabel = script.Parent

killerEvent.OnClientEvent:Connect(function(plr,killername)
	if plr and killername then
		wait(1)
		local newLabel = textLabel:Clone()
		local plrname = plr.Name
		killername.TextColor = killername.TeamColor
		plrname.TextColor = plrname.TeamColor
		newLabel.Text = killername.." > "..plr.Name
		newLabel.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui").KillFeed.Frame
		wait(1)
		newLabel:Destroy()
	end
end)

That wouldn’t work -

plr.Name only returns a string

to make it work you would need to do this -

First you would need to instead make the killername arg to the killer player which then you would need to add .Name to some parts

To get the color3 of their teams you would need to do this


plr.Team.TeamColor.color

and the same for the killer

Then you would need to enable rich text on your text label in able to make the string have two different colors and to do that i advice you look into tutorials on rich text

local killerEvent = game.ReplicatedStorage.KillEvent
local textLabel = script.Parent

killerEvent.OnClientEvent:Connect(function(plr,killername)
	if plr and killername then
		wait(1)
		local newLabel = textLabel:Clone()
		local plrname = plr.Name
		newLabel.RichText = true
		killername.TextColor3 = killername.TeamColor.Color
		plrname.TextColor3 = plrname.TeamColor.Color
		newLabel.Text = killername.." > "..plrname
		newLabel.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui").KillFeed.Frame
		wait(1)
		newLabel:Destroy()
	end
end)

This won’t work, i highly recommend watching some tutorials on scripting before going into stuff like this as there is alot to explain and i am currently on mobile

I recommend alvinBlox or TheDevKing - they have good tutorials

You think i couldn’t script? That`s rude

i am not being rude, i said that off the fact of how you implemented my answer into your code.