Author Topic: Can someone pease help with my lua problem  (Read 1791 times)

0 Members and 2 Guests are viewing this topic.

Offline Shadow Knight

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Can someone pease help with my lua problem
« on: May 21, 2017, 09:51:59 AM »
I have a militaryRP server and i want staff and donators to spawn with phygun and toolgun but its working i put it in this dir garrysmod/lua/server/weapons.lua

Heres my code

function Custom_Loadout( ply )
//All Staff
   if ( ply:IsUserGroup( "owner" ) or ply:IsUserGroup( "community-manager" ) or ply:IsUserGroup( "staff-manager" ) or ply:IsUserGroup( "server-builder" ) or ply:IsUserGroup( "superadmin" ) or ply:IsUserGroup( "admin" ) or ply:IsUserGroup( "moderator" ) or ply:IsUserGroup( "trial-moderator" )) then
      
      ply:Give( "weapon_physgun" )
      ply:Give( "weapon_tool" )
 
   end

//Donators
   if ( ply:IsUserGroup( "donator" ) or ply:IsUserGroup( "donator+" ) or ply:IsUserGroup( "donator++" ))

      ply:Give( "weapon_physgun" )
      ply:Give( "weapon_tool" )


        end
end
hook.Add( "PlayerLoadout", "CustomGamemodeLoadoutFunction", Custom_Loadout )


An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given