LUA 191
V1+ 3 Weapons 2.0 By xdedeone on 26th February 2019 08:19:01 PM
  1. -- 3 Weapons
  2. -- By «§H»Kennan{Leader}
  3. -- Xfire : kenster789
  4. -- This script will force the 3 desired guns into their hands.
  5. -- Version 2.00 (1.00 not released)
  6. -- If you find any bugs or have any request or questions just message me over xfire.
  7. -- I have tested this script with the 3 weapons that are alreay in it.
  8.  
  9. -- This script will destory what ever weapons they spawn with. So if you want them to spawn with the regular Pistol and Assault plus another gun, you will need to place
  10. -- the Pistol and Assault rifle tags in two of the slots below.
  11.  
  12. -- If you want the order that a player is holding them to be different just move the tags around in the 3 slots until they are in the desired holding order.
  13.  
  14. --------------------------------IMPORTANT-----------------------------------------
  15. -- THE STARTING EQUIPEMENT FOR THE GAMETYPE HAS TO BE CUSTOME OR IT WILL NOT WORK.
  16. ----------------------------------------------------------------------------------
  17. ----------------------------------------------------------------------------------
  18.  
  19.  
  20.  
  21. first_weapon_tag = "weapons\\assault rifle\\assault rifle" -- First Weapon Tag
  22. second_weapon_tag = "weapons\\pistol\\pistol" -- Second Weapon Tag
  23. third_weapon_tag = "weapons\\shotgun\\shotgun" -- Third Weapon Tag
  24.  
  25.  
  26. -- The below is a list of the useable guns.
  27. -- Assault rifle, "weapons\\assault rifle\\assault rifle"
  28. -- The Oddball Skull, "weapons\\ball\\ball"
  29. -- Flag, "weapons\\flag\\flag"
  30. -- Flame Thrower, "weapons\\flamethrower\\flamethrower"
  31. -- Needler, "weapons\\needler\\mp_needler"
  32. -- Pistol, "weapons\\pistol\\pistol"
  33. -- Plasma Pistol, "weapons\\plasma pistol\\plasma pistol"
  34. -- Plasma Rifle, "weapons\\plasma rifle\\plasma rifle"
  35. -- Fuel rod, "weapons\\plasma_cannon\\plasma_cannon"
  36. -- Rocket Launcher, "weapons\\rocket launcher\\rocket launcher"
  37. -- Shot Gun, "weapons\\shotgun\\shotgun"
  38. -- Sniper Rifle, "weapons\\sniper rifle\\sniper rifle"
  39.  
  40.  
  41.  
  42.  
  43. function GetRequiredVersion()
  44.  
  45.         return 10057
  46. end
  47.  
  48. function OnScriptLoad(process)
  49.  
  50.  
  51. end
  52.  
  53. function OnScriptUnload()
  54.  
  55.  
  56. end
  57.  
  58. function OnNewGame(map)
  59.  
  60. end
  61.  
  62. function OnGameEnd(mode)
  63.  
  64.  
  65. end
  66.  
  67. function OnServerChat(player, chattype, message)
  68.  
  69.         return 1
  70. end
  71.  
  72. function OnServerCommand(player, command)
  73.  
  74.         return 1
  75. end
  76.  
  77. function OnTeamDecision(team)
  78.  
  79.         return team
  80. end
  81.  
  82. function OnPlayerJoin(player, team)
  83.  
  84.  
  85.  
  86. end
  87.  
  88. function OnPlayerLeave(player, team)
  89.  
  90.  
  91. end
  92.  
  93. function OnPlayerKill(killer, victim, mode)
  94.  
  95.  
  96. end
  97.  
  98. function OnKillMultiplier(player, multiplier)
  99.  
  100.  
  101. end
  102.  
  103. function OnPlayerSpawn(player, m_objectId)
  104.  
  105. end
  106.  
  107. function OnPlayerSpawnEnd(player, m_objectId)
  108.                
  109.                 for i = 0,3 do -- Loop through the player's weapons.
  110.                         local m_object = getobject(m_objectId) -- Get the object ID.
  111.                         if m_object then -- Ff the object(the player) is alive.
  112.                                 local weapID = readdword(m_object, 0x2F8 + i*4) -- Get the ID of the weapons.
  113.                                 local weap = getobject(weapID) -- Get the weapons Object ID.
  114.                                 if weap then -- If the weapon exist.
  115.                                         destroyobject(weapID)  -- Destroy it.
  116.                                 end
  117.                         end
  118.                 end
  119.                
  120.                 local first_gun = createobject("weap", first_weapon_tag, 0, 1, false, 0, 0, 0) -- Create the first weapon.
  121.                 local second_gun = createobject("weap", second_weapon_tag, 0, 1, false, 0, 0, 0) -- Create the second weapon.
  122.                 local third_gun = createobject("weap", third_weapon_tag, 0, 1, false, 0, 0, 0) -- Create the third weapon.
  123.                
  124.                 assignweapon(player, first_gun) -- Force the first_gun into their hands.
  125.                 assignweapon(player, second_gun) -- Force the second_gun into their hands.
  126.                 assignweapon(player, third_gun) -- Force the third_gun into their hands.
  127. end
  128.  
  129. function OnTeamChange(relevant, player, cur_team, dest_team)
  130.  
  131.         return 1
  132. end
  133.  
  134. function OnObjectCreation(m_objId, player, tagName)
  135.  
  136.  
  137. end
  138.  
  139. function OnObjectInteraction(player, m_objId, tagType, tagName)
  140.  
  141.         return 1
  142. end
  143.  
  144. function OnWeaponAssignment(player, m_objId, slot, tagName)
  145.  
  146.         return 0
  147. end
  148.  
  149. function OnWeaponReload(player, m_weapId)
  150.  
  151.         return 1
  152. end
  153.  
  154. function OnDamageLookup(receiver, causer, tagData, tagName)
  155.  
  156. end
  157.  
  158. function OnVehicleEntry(relevant, player, m_vehicleId, tagName, seat)
  159.  
  160.  
  161.         return 1
  162. end
  163.  
  164. function OnVehicleEject(player, forced)
  165.  
  166.         return 1
  167. end
  168.  
  169. function OnClientUpdate(player, m_objId)
  170.  
  171.  
  172. end

HaloNet.Net is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.