How to pass extra kill variables without it becoming a long mess?

I want to pass through the stats awarded to a player when they make a kill, however I feel it’s taking up too much space and thus becoming very cluttered and unreasonable. Is there a better solution to this?

-- Award
local CashGiven = UpdateCash(Killer, Settings.CASH_PER_TAG, true)
local ExpGiven = 0
				
if Creator:FindFirstChild("Longshot") then -- Longshot
	LongshotCashGiven = UpdateCash(Killer, Settings.CASH_PER_LONGSHOT, true)
	LongshotExpGiven = 0
end
				
if Creator:FindFirstChild("Headshot") then -- Headshot
	HeadshotCashGiven = UpdateCash(Killer, Settings.CASH_PER_HEADSHOT, true)
	HeadshotExpGiven = 0
end
				
-- Tell player
AwardReport:FireClient(
	Killer,
	CashGiven,
	ExpGiven,
	"Tag",
	{
		TaggedPlayer = player.DisplayName,
		TaggedTeam = player.TeamColor.Color
	},
	{
		LongshotCashGiven,
		LongshotExpGiven,
		
		HeadshotCashGiven,
		HeadshotExpGiven,
	}
)
local function UpdateAwards(cashGiven, expGiven, awardType, info, extra)

end
1 Like

Instead of using locals, put them in a table and loop through the table/index the needed “stat”.