Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local playermodels = {
- "adolf",
- "something_else",
- }
- local weapons = {}
- weapons.ak47 = {
- baseClass = "weapon_jb_ak47",
- psClass = "ak47",
- skinClass = "clt_akvlcn",
- }
- hook.Add( "PlayerCanPickupWeapon", "ApplyCustomSkin:PlayerCanPickupWeapon", function( ply, weapon )
- for _,wep in pairs( weapons ) do
- if weapon:GetClass() == wep.baseClass and ply:PS_HasItemEquipped( wep.psClass ) then
- weapon:Remove()
- ply:Give( wep.skinClass )
- return false
- end
- end
- end )
- hook.Add( "PlayerSpawn", "ResetGuardPlayermodel:PlayerSpawn", function( ply )
- if ply:Team() == TEAM_GUARD then
- for _,model in pairs( playermodels ) do
- if ply:PS_HasItemEquipped( model ) then
- ply:PS_HolsterItem( model )
- break
- end
- end
- end
- end )
- -- Old Script:
- hook.Add( "PlayerCanPickupWeapon", "Custom Skins", function( ply, wep )
- // Ak47
- if wep:GetClass() == "weapon_jb_ak47" and ply:PS_HasItemEquipped('ak47') then -- if the weapon they are trying to pick up is a pistol
- ply:Give( "clt_akvlcn" ) -- give them an RPG
- wep:Remove() -- remove the one they were trying to pick up
- return false -- don't give them a pistol
- end
- // Five-Seven
- 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
- ply:Give( "p250mehndi" ) -- give them an RPG
- wep:Remove() -- remove the one they were trying to pick up
- return false -- don't give them a pistol
- end
- // M4A1
- if wep:GetClass() == "weapon_jb_m4a1" and ply:PS_HasItemEquipped('m4a1') then -- if the weapon they are trying to pick up is a pistol
- ply:Give( "clt_m4a4_asim" ) -- give them an RPG
- wep:Remove() -- remove the one they were trying to pick up
- return false -- don't give them a pistol
- end
- // Knife
- if wep:GetClass() == "weapon_jb_knife" and ply:PS_HasItemEquipped('knife') then -- if the weapon they are trying to pick up is a pistol
- ply:Give( "clt_karamfde" ) -- give them an RPG
- wep:Remove() -- remove the one they were trying to pick up
- return false -- don't give them a pistol
- end
- // AWP
- if wep:GetClass() == "weapon_jb_awp" and ply:PS_HasItemEquipped('awp') then -- if the weapon they are trying to pick up is a pistol
- ply:Give( "awp_gentleman" ) -- give them an RPG
- wep:Remove() -- remove the one they were trying to pick up
- return false -- don't give them a pistol
- end
- // Deagle
- if wep:GetClass() == "weapon_jb_deagle" and ply:PS_HasItemEquipped('deagle') then -- if the weapon they are trying to pick up is a pistol
- ply:Give( "weapon_shitty_gold_de" ) -- give them an RPG
- wep:Remove() -- remove the one they were trying to pick up
- return false -- don't give them a pistol
- end
- end )
- // Models
- local function spawn( ply )
- if(ply:PS_HasItemEquipped("adolf")) and (ply:Team() == TEAM_GUARD) then
- ply:PS_HolsterItem("adolf")
- end
- if(ply:PS_HasItemEquipped("davy")) and (ply:Team() == TEAM_GUARD) then
- ply:PS_HolsterItem("davy")
- end
- if(ply:PS_HasItemEquipped("joker")) and (ply:Team() == TEAM_GUARD) then
- ply:PS_HolsterItem("joker")
- end
- if(ply:PS_HasItemEquipped("osama")) and (ply:Team() == TEAM_GUARD) then
- ply:PS_HolsterItem("osama")
- end
- if(ply:PS_HasItemEquipped("smith")) and (ply:Team() == TEAM_GUARD) then
- ply:PS_HolsterItem("smith")
- end
- if(ply:PS_HasItemEquipped("terminator")) and (ply:Team() == TEAM_GUARD) then
- ply:PS_HolsterItem("terminator")
- end
- if(ply:PS_HasItemEquipped("vader")) and (ply:Team() == TEAM_GUARD) then
- ply:PS_HolsterItem("vader")
- end
- if(ply:PS_HasItemEquipped("voldermort")) and (ply:Team() == TEAM_GUARD) then
- ply:PS_HolsterItem("voldermort")
- end
- end
- hook.Add( "PlayerSpawn", "some_unique_name", spawn )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement