DaBOSS54320

Bully LUA: Genocide

May 8th, 2016
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.28 KB | None | 0 0
  1. -- Jimmy has modified his spudgun to shoot with significantly more power.
  2. -- What he found is that his spudgun is now able to do a little more than just knock out his opponents.
  3.  
  4. function main()
  5.     -- Let the game start up:
  6.     Wait(500)
  7.    
  8.     -- Create other threads:
  9.     CreateThread("T_Blip")
  10.    
  11.     -- Setup:
  12.     gDeadPedNames = {}
  13.     local deadPeds = {}
  14.     local damageScale
  15.    
  16.     -- Main loop:
  17.     while true do
  18.         -- Process peds:
  19.         for i,ped in {PedFindInAreaXYZ(0,0,0,999999)} do
  20.             if i > 1 and ped ~= gPlayer then
  21.                 local name = PedGetName(ped)
  22.                 if deadPeds[name] and not PedIsDead(ped) then
  23.                     PedSetUniqueModelStatus(PedGetModel(ped),-1)
  24.                     PedDelete(ped)
  25.                 elseif not deadPeds[name] and PedIsDead(ped) and PedGetWhoHitMeLast(ped) == gPlayer and PedGetLastHitWeapon(ped) == 316 then
  26.                     GameSetPedStat(ped,20,0)
  27.                     PedPlayHitReaction(ped)
  28.                     SoundRemoveAllQueuedSpeech(ped,true)
  29.                     deadPeds[name] = true
  30.                     table.insert(gDeadPedNames,name)
  31.                     PedSetUniqueModelStatus(PedGetModel(ped),-1)
  32.                 end
  33.             end
  34.         end
  35.        
  36.         -- Strong spudgun:
  37.         if PlayerHasWeapon(305) and PedIsPlaying(gPlayer,"/Global/Gun/Gun/Default_KEY",true) then
  38.             -- Give spuds:
  39.             if PedGetAmmoCount(gPlayer,316) < 8 then
  40.                 GiveAmmoToPlayer(316,8,false)
  41.             end
  42.            
  43.             -- Increase damage:
  44.             if not damageScale then
  45.                 damageScale = GameGetPedStat(gPlayer,31)
  46.                 GameSetPedStat(gPlayer,31,damageScale*10)
  47.             end
  48.         elseif damageScale then
  49.             -- Restore damage:
  50.             GameSetPedStat(gPlayer,31,damageScale)
  51.             damageScale = nil
  52.         end
  53.        
  54.         -- Wait:
  55.         Wait(0)
  56.     end
  57. end
  58.  
  59. function T_Blip()
  60.     BlipSetShortRanged(BlipAddXYZ(-490.7,314.6,31.4,0,0,1),true)
  61.     while true do
  62.         if PedIsInAreaXYZ(gPlayer,-490.7,314.6,31.4,0.8) and PedMePlaying(gPlayer,"Default_KEY") then
  63.             TextPrintString("Press \b to see dead peds.",0,2)
  64.             Wait(0)
  65.             if IsButtonBeingPressed(9,0) then
  66.                 PlayerSetControl(0)
  67.                 local s = 1
  68.                 repeat
  69.                     local text = "R.I.P.\n\n"
  70.                     for i=s-3,s+3 do
  71.                         if i >= 1 and i <= table.getn(gDeadPedNames) then
  72.                             text = text..i..". "..gDeadPedNames[i]
  73.                         end
  74.                         text = text.."\n"
  75.                     end
  76.                     TextPrintString(text,0,1)
  77.                     TextPrintString("Press \t to exit.",0,2)
  78.                     Wait(0)
  79.                     if IsButtonBeingPressed(2,0) and s > 1 then
  80.                         s = s - 1
  81.                     elseif IsButtonBeingPressed(3,0) and s < table.getn(gDeadPedNames) then
  82.                         s = s + 1
  83.                     end
  84.                 until IsButtonBeingPressed(8,0)
  85.                 PlayerSetControl(1)
  86.             end
  87.         else
  88.             Wait(0)
  89.         end
  90.     end
  91. end
  92.  
  93. function PedGetModel(ped)
  94.     for m = 0,258 do
  95.         if PedIsModel(ped,m) then
  96.             return m
  97.         end
  98.     end
  99. end
  100.  
  101. -- STimeCycle functions:
  102. F_AttendedClass = function()
  103.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  104.         return
  105.     end
  106.     SetSkippedClass(false)
  107.     PlayerSetPunishmentPoints(0)
  108. end
  109.  
  110. F_MissedClass = function()
  111.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  112.         return
  113.     end
  114.     SetSkippedClass(true)
  115.     StatAddToInt(166)
  116. end
  117.  
  118. F_AttendedCurfew = function()
  119.     if not PedInConversation(gPlayer) and not MissionActive() then
  120.         TextPrintString("You got home in time for curfew", 4)
  121.     end
  122. end
  123.  
  124. F_MissedCurfew = function()
  125.     if not PedInConversation(gPlayer) and not MissionActive() then
  126.         TextPrint("TM_TIRED5", 4, 2)
  127.     end
  128. end
  129.  
  130. F_StartClass = function()
  131.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  132.         return
  133.     end
  134.     F_RingSchoolBell()
  135.     local l_6_0 = PlayerGetPunishmentPoints() + GetSkippingPunishment()
  136. end
  137.  
  138. F_EndClass = function()
  139.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  140.         return
  141.     end
  142.     F_RingSchoolBell()
  143. end
  144.  
  145. F_StartMorning = function()
  146.     F_UpdateTimeCycle()
  147. end
  148.  
  149. F_EndMorning = function()
  150.     F_UpdateTimeCycle()
  151. end
  152.  
  153. F_StartLunch = function()
  154.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  155.         F_UpdateTimeCycle()
  156.         return
  157.     end
  158.     F_UpdateTimeCycle()
  159. end
  160.  
  161. F_EndLunch = function()
  162.     F_UpdateTimeCycle()
  163. end
  164.  
  165. F_StartAfternoon = function()
  166.     F_UpdateTimeCycle()
  167. end
  168.  
  169. F_EndAfternoon = function()
  170.     F_UpdateTimeCycle()
  171. end
  172.  
  173. F_StartEvening = function()
  174.     F_UpdateTimeCycle()
  175. end
  176.  
  177. F_EndEvening = function()
  178.     F_UpdateTimeCycle()
  179. end
  180.  
  181. F_StartCurfew_SlightlyTired = function()
  182.     F_UpdateTimeCycle()
  183. end
  184.  
  185. F_StartCurfew_Tired = function()
  186.     F_UpdateTimeCycle()
  187. end
  188.  
  189. F_StartCurfew_MoreTired = function()
  190.     F_UpdateTimeCycle()
  191. end
  192.  
  193. F_StartCurfew_TooTired = function()
  194.     F_UpdateTimeCycle()
  195. end
  196.  
  197. F_EndCurfew_TooTired = function()
  198.     F_UpdateTimeCycle()
  199. end
  200.  
  201. F_EndTired = function()
  202.     F_UpdateTimeCycle()
  203. end
  204.  
  205. F_Nothing = function()
  206. end
  207.  
  208. F_ClassWarning = function()
  209.     if IsMissionCompleated("3_08") and not IsMissionCompleated("3_08_PostDummy") then
  210.         return
  211.     end
  212.     local l_23_0 = math.random(1, 2)
  213. end
  214.  
  215. F_UpdateTimeCycle = function()
  216.     if not IsMissionCompleated("1_B") then
  217.         local l_24_0 = GetCurrentDay(false)
  218.         if l_24_0 < 0 or l_24_0 > 2 then
  219.             SetCurrentDay(0)
  220.         end
  221.     end
  222.     F_UpdateCurfew()
  223. end
  224.  
  225. F_UpdateCurfew = function()
  226.     local l_25_0 = shared.gCurfewRules
  227.     if not l_25_0 then
  228.         l_25_0 = F_CurfewDefaultRules
  229.     end
  230.     l_25_0()
  231. end
  232.  
  233. F_CurfewDefaultRules = function()
  234.     local l_26_0 = ClockGet()
  235.     if l_26_0 >= 23 or l_26_0 < 7 then
  236.         shared.gCurfew = true
  237.     else
  238.         shared.gCurfew = false
  239.     end
  240. end
Advertisement
Add Comment
Please, Sign In to add comment