Advertisement
Guest User

Untitled

a guest
Aug 27th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.72 KB | None | 0 0
  1. local playermodels = {
  2.     "adolf",
  3.     "something_else",
  4. }
  5.  
  6. local weapons = {}
  7.  
  8. weapons.ak47 = {
  9.     baseClass = "weapon_jb_ak47",
  10.     psClass = "ak47",
  11.     skinClass = "clt_akvlcn",
  12. }
  13.  
  14. hook.Add( "PlayerCanPickupWeapon", "ApplyCustomSkin:PlayerCanPickupWeapon", function( ply, weapon )
  15.  
  16.     for _,wep in pairs( weapons ) do
  17.  
  18.         if weapon:GetClass() == wep.baseClass and ply:PS_HasItemEquipped( wep.psClass ) then
  19.  
  20.             weapon:Remove()
  21.             ply:Give( wep.skinClass )
  22.             return false
  23.  
  24.         end
  25.  
  26.     end
  27.  
  28. end )
  29.  
  30. hook.Add( "PlayerSpawn", "ResetGuardPlayermodel:PlayerSpawn", function( ply )
  31.  
  32.     if ply:Team() == TEAM_GUARD then
  33.  
  34.         for _,model in pairs( playermodels ) do
  35.  
  36.             if ply:PS_HasItemEquipped( model ) then
  37.  
  38.                 ply:PS_HolsterItem( model )
  39.                 break
  40.  
  41.             end
  42.  
  43.         end
  44.  
  45.     end
  46.  
  47. end )
  48.  
  49. -- Old Script:
  50.  
  51. hook.Add( "PlayerCanPickupWeapon", "Custom Skins", function( ply, wep )
  52.     // Ak47
  53.     if wep:GetClass() == "weapon_jb_ak47" and ply:PS_HasItemEquipped('ak47') then -- if the weapon they are trying to pick up is a pistol
  54.         ply:Give( "clt_akvlcn" ) -- give them an RPG
  55.         wep:Remove() -- remove the one they were trying to pick up
  56.         return false -- don't give them a pistol
  57.     end
  58.  
  59.     // Five-Seven
  60.     if wep:GetClass() == "weapon_jb_fiveseven" and ply:PS_HasItemEquipped('five-seven') then -- if the weapon they are trying to pick up is a pistol
  61.         ply:Give( "p250mehndi" ) -- give them an RPG
  62.         wep:Remove() -- remove the one they were trying to pick up
  63.         return false -- don't give them a pistol
  64.     end
  65.  
  66.     // M4A1
  67.     if wep:GetClass() == "weapon_jb_m4a1" and ply:PS_HasItemEquipped('m4a1') then -- if the weapon they are trying to pick up is a pistol
  68.         ply:Give( "clt_m4a4_asim" ) -- give them an RPG
  69.         wep:Remove() -- remove the one they were trying to pick up
  70.         return false -- don't give them a pistol
  71.     end
  72.  
  73.     // Knife
  74.     if wep:GetClass() == "weapon_jb_knife" and ply:PS_HasItemEquipped('knife') then -- if the weapon they are trying to pick up is a pistol
  75.         ply:Give( "clt_karamfde" ) -- give them an RPG
  76.         wep:Remove() -- remove the one they were trying to pick up
  77.         return false -- don't give them a pistol
  78.     end
  79.  
  80.     // AWP
  81.     if wep:GetClass() == "weapon_jb_awp" and ply:PS_HasItemEquipped('awp') then -- if the weapon they are trying to pick up is a pistol
  82.         ply:Give( "awp_gentleman" ) -- give them an RPG
  83.         wep:Remove() -- remove the one they were trying to pick up
  84.         return false -- don't give them a pistol
  85.     end
  86.  
  87.     // Deagle
  88.     if wep:GetClass() == "weapon_jb_deagle" and ply:PS_HasItemEquipped('deagle') then -- if the weapon they are trying to pick up is a pistol
  89.         ply:Give( "weapon_shitty_gold_de" ) -- give them an RPG
  90.         wep:Remove() -- remove the one they were trying to pick up
  91.         return false -- don't give them a pistol
  92.     end
  93. end )
  94.  
  95. // Models
  96. local function spawn( ply )
  97.     if(ply:PS_HasItemEquipped("adolf")) and (ply:Team() == TEAM_GUARD) then
  98.         ply:PS_HolsterItem("adolf")
  99.     end
  100.  
  101.     if(ply:PS_HasItemEquipped("davy")) and (ply:Team() == TEAM_GUARD) then
  102.         ply:PS_HolsterItem("davy")
  103.     end
  104.  
  105.     if(ply:PS_HasItemEquipped("joker")) and (ply:Team() == TEAM_GUARD) then
  106.         ply:PS_HolsterItem("joker")
  107.     end
  108.  
  109.     if(ply:PS_HasItemEquipped("osama")) and (ply:Team() == TEAM_GUARD) then
  110.         ply:PS_HolsterItem("osama")
  111.     end
  112.  
  113.     if(ply:PS_HasItemEquipped("smith")) and (ply:Team() == TEAM_GUARD) then
  114.         ply:PS_HolsterItem("smith")
  115.     end
  116.  
  117.     if(ply:PS_HasItemEquipped("terminator")) and (ply:Team() == TEAM_GUARD) then
  118.         ply:PS_HolsterItem("terminator")
  119.     end
  120.     if(ply:PS_HasItemEquipped("vader")) and (ply:Team() == TEAM_GUARD) then
  121.         ply:PS_HolsterItem("vader")
  122.     end
  123.  
  124.     if(ply:PS_HasItemEquipped("voldermort")) and (ply:Team() == TEAM_GUARD) then
  125.         ply:PS_HolsterItem("voldermort")
  126.     end
  127. end
  128. hook.Add( "PlayerSpawn", "some_unique_name", spawn )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement