Hello all... again.... Anyway, I made a simply little script for my server where the player gets points if they kill a player. Here is the code:
hook.Add("PlayerDeath","AwardPointShopPoints",function( ply,inf,attacker)if(attacker:IsPlayer()) then
attacker:AddStandardPoints(25)
end )
As you can see it is very short, but I do not understand why this doesn't work... I am new to lua so if there is an obvious reason I'm sorry :/ I put this code into lua > autorun > client > pointskill.lua
This would be considered server side code adding points. Client is for HUDs / visual you'd never want to do a adding points / currency via client because the client could change your 25 to 1 billion.
attacker can be invalid, check for IsValid and if the attacker is not the victim, as suicide would
grant points if not.
Sorry, you need to Log In to post a reply to this thread.