Ok so i created something that gives a amount based on usergroup and stuff. It works fine problem is that if i die to fall damage or a prop (If i had in the gamemode this is made for) it just creates a error and WONT reset the players score as it supposed to do on death.
Error : [CODE]
[ERROR] addons/exp_beta/lua/autorun/server/exp_stuff_server.lua:22: attempt to call method 'GetUserGroup' (a nil value)
1. fn - addons/exp_beta/lua/autorun/server/exp_stuff_server.lua:22
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
[/CODE]
Code : [CODE] if ( table.HasValue ( _Groups, attacker:GetUserGroup( ) ) ) then
_GiveScore( attacker )
elseif ( table.HasValue ( _VIPGroups, attacker:GetUserGroup( ) ) || attacker:IsAdmin( ) || attacker:IsSuperAdmin( ) ) then
_GiveScoreVIP( attacker )
end[/CODE]
[CODE]local _VIPGroups = { "VIP", "owner" }
local _Groups = { "user", "member" }[/CODE]
Check if Attacker a valid player before line 22.
Yeah i was stupid. Needed to move abit code but thanks
Sorry, you need to Log In to post a reply to this thread.