Advertisement
Day_Tripper

Prison Rrchitect: Snitch Sorter: mod of original

Oct 16th, 2016
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. function Create()
  2.  
  3.     --print();
  4.    
  5. end
  6.  
  7. local timeTot=0;
  8.  
  9. function Update( timePassed )
  10.     if updateTime==nil then
  11.         updateTime = 15 + math.random(1,50);
  12.     end
  13.     if timeTot==nil then timeTot=0; end
  14.     timeTot = timeTot + timePassed;
  15.     if timeTot>=updateTime then
  16.         timeTot=0;
  17.         updateTime=15
  18.         local prisoners = Object.GetNearbyObjects(this, "Prisoner", 10);
  19.         if prisoners~=nil then
  20.             for name,dist in pairs( prisoners ) do
  21.                 if name.SnitchTimer~=0 and name.Category~='DeathRow' then
  22.                     --Game.DebugOut("Prisoner is snitch");
  23.                     Object.SetProperty(name,"Category",4);
  24.                 elseif name.Gang.Rank == "Lieutenant" and name.Category~='DeathRow' then
  25.                     --Game.DebugOut("Prisoner is a Lieutenant");
  26.                     Object.SetProperty(name,"Category",5);
  27.                 elseif name.Gang.Rank == "Leader" and name.Category~='DeathRow' then
  28.                     --Game.DebugOut("Prisoner is a Leader");
  29.                     Object.SetProperty(name,"Category",1);
  30.                 end
  31.                
  32.             end
  33.         end
  34.     end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement