Points distribution through pointshop

Hi, I was thinking about making a deathrun server with this pointshop.

However I was wondering if their was a way to award a player with points when they kill
a death at the end of the map.

this should work :slight_smile:



local amount = 10;
hook.Add( "PlayerDeath", "KillPoints", function( victim, weapon, killer)
    if( IsValid( killer ) and IsValid( victim ) ) then
        if( killer:IsPlayer() and victim:IsPlayer() ) then
            if ( killer:Team() == TEAM_RUNNER and victim:Team() == TEAM_DEATH ) then
                killer:PS_GivePoints( amount );
                killer:PS_Notify("You've been given "..amount.." points for killing a death!");
            elseif ( killer:Team() == TEAM_DEATH and victim:Team() == TEAM_RUNNER ) then
                killer:PS_GivePoints( amount );
                killer:PS_Notify("You've been given "..amount.." points for killing a runner!");
            end;
        end;
    end;
end )


Thanks, helped a lot!

Also in the spots where it says amount am I supposed to fill that in with the amount I want to give them.

Where exactly should I put this file?

Copy/paste the lua script above into lua/sv_pointshop.lua and it should work perfectly (I tested it myself).
I believe he made amount a variable so that you can customize it, yes. ONLY change the bit that says local amount = 10, change the number to whatever you want. DO NOT EDIT ANYTHING ELSE and you should be fine.