SHARE
TWEET

Untitled

a guest Oct 18th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local loaded = false
  2.  
  3. function onClientPlayerSkinChange( prevSlot,newSlot )
  4.     local getSlot = getPedWeaponSlot(localPlayer)
  5.     if newSlot == 0 then
  6.         loaded = false
  7.     elseif newSlot == 1 or newSlot == 2 or newSlot == 4 then
  8.         if getElementData(localPlayer,"currentweapon_2") == "AK74u" then
  9.             if not loaded then
  10.                 engineImportTXD(weaponTXD[8], 353)
  11.                 engineReplaceModel(weaponDFF[8],353)
  12.                 loaded = true
  13.             else
  14.                 return
  15.             end
  16.         elseif getElementData(localPlayer,"currentweapon_2") == "UMP45" then
  17.             if not loaded then
  18.                 engineImportTXD(weaponTXD[9], 353)
  19.                 engineReplaceModel(weaponDFF[9],353)
  20.                 loaded = true
  21.             else
  22.                 return
  23.             end
  24.         else
  25.             loaded = false
  26.         end
  27.     elseif newSlot == 3 or newSlot == 5 or newSlot == 6 or newSlot == 7 then
  28.         if getElementData(localPlayer,"currentweapon_1") == "M60" then
  29.             if not loaded then
  30.                 engineImportTXD(weaponTXD[1], 355)
  31.                 engineReplaceModel(weaponDFF[1],355)
  32.                 loaded = true
  33.             else
  34.                 return
  35.             end
  36.         elseif getElementData(localPlayer,"currentweapon_1") == "LSAT" then
  37.             if not loaded then
  38.                 engineImportTXD(weaponTXD[2], 355)
  39.                 engineReplaceModel(weaponDFF[2],355)
  40.                 loaded = true
  41.             else
  42.                 return
  43.             end
  44.         elseif getElementData(localPlayer,"currentweapon_1") == "M4A1 Silenced" then
  45.             if not loaded then
  46.                 engineImportTXD(weaponTXD[3], 356)
  47.                 engineReplaceModel(weaponDFF[3],356)
  48.                 loaded = true
  49.             else
  50.                 return
  51.             end
  52.         elseif getElementData(localPlayer,"currentweapon_1") == "ACR" then
  53.             if not loaded then
  54.                 engineImportTXD(weaponTXD[4], 356)
  55.                 engineReplaceModel(weaponDFF[4],356)
  56.                 loaded = true
  57.             else
  58.                 return
  59.             end
  60.         elseif getElementData(localPlayer,"currentweapon_1") == "M16A4" then
  61.             if not loaded then
  62.                 engineImportTXD(weaponTXD[11], 356)
  63.                 engineReplaceModel(weaponDFF[11],356)
  64.                 loaded = true
  65.             else
  66.                 return
  67.             end
  68.         elseif getElementData(localPlayer,"currentweapon_1") == "AR15" then
  69.             if not loaded then
  70.                 engineImportTXD(weaponTXD[5], 356)
  71.                 engineReplaceModel(weaponDFF[5],356)
  72.                 loaded = true
  73.             else
  74.                 return
  75.             end
  76.         elseif getElementData(localPlayer,"currentweapon_1") == "AS50" then
  77.             if not loaded then
  78.                 engineImportTXD(weaponTXD[6], 358)
  79.                 engineReplaceModel(weaponDFF[6],358)
  80.                 loaded = true
  81.             else
  82.                 return
  83.             end
  84.         elseif getElementData(localPlayer,"currentweapon_1") == "AWP" then
  85.             if not loaded then
  86.                 engineImportTXD(weaponTXD[7], 358)
  87.                 engineReplaceModel(weaponDFF[7],358)
  88.                 loaded = true
  89.             else
  90.                 return
  91.             end
  92.         elseif getElementData(localPlayer,"currentweapon_1") == "AK47" then
  93.             if not loaded then
  94.                 engineImportTXD(weaponTXD[10], 356)
  95.                 engineReplaceModel(weaponDFF[10],356)
  96.                 loaded = true
  97.             else
  98.                 return
  99.             end
  100.         else
  101.             loaded = false
  102.         end
  103.     else
  104.         loaded = false
  105.     end
  106. end
  107. addEventHandler( "onClientPlayerWeaponSwitch", localPlayer, onClientPlayerSkinChange )
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top