+1 point for every kill (if player gets killed, the attacker gets...)

I am very new to lua, and only know how to mess around with weapons.

Lets say I’m in a garrysmod game, and I kill someone.
And I get a shotgun. What would be the code for that?

garrysmod/lua/autorun/server/yourfile.lua

[lua]
function RewardKiller( victim, inflictor, killer )
if killer:IsPlayer() then
ply:Give( “weapon_pumpshotgun” )
end
end
hook.Add( “PlayerDeath”, “RewardKiller”, RewardKiller )
[/lua]

I guess you mean

[lua]
function RewardKiller( victim, inflictor, killer )
if killer:IsPlayer() then
killer:Give( “weapon_pumpshotgun” )
end
end
hook.Add( “PlayerDeath”, “RewardKiller”, RewardKiller )
[/lua]

-.-’

Yes, I mean that. -blushes awkwardly at fail nub mistake-

[lua]function Reward( victim, inflictor, killer )
if victim:IsPlayer() && killer:IsPlayer() then --If both victim and killer are players then…
if killer:GetNWInt(“kills”) == nil then --If killer’s Networked Integer has not been set, then…
killer:SetNWInt(“kills”, 0) --Set the killers Networked Integer to 0
end
killer:SetNWInt(“kills”, killer:GetNWInt(“kills”) + 1) --Add 1 onto the killer’s killstreak
killer:Give(“weapon_pumpshotgun”) --Give him a shotgun
victim:SetNWInt(“kills”, 0) --Set the dead person’s kills to 0 ( resetting his killstreak )
end
end
hook.Add(“PlayerDeath”, “Reward”, Reward)[/lua]

Commented for your convenience. To keep a constant killstreak going without resetting even if the player dies, just remove the

[lua] if killer:GetNWInt(“kills”) == nil then --If killer’s Networked Integer has not been set, then…
killer:SetNWInt(“kills”, 0) --Set the killers Networked Integer to 0
end[/lua]

Part

[editline]11:47PM[/editline]

I think using NWInt is useful here, because you could keep score of their killstreak, and give them weapons depending on the amount of kills they have total