Roblox Script -- City Life | [Auto Farm (POLICE)(ARREST ALL)]


ARREST ALL CRIMINALS



Code:

local plr = game.Players.LocalPlayer

local plrList = game.Players

local hRp = plr.Character.HumanoidRootPart


for playerIndex, player in pairs (plrList:GetChildren()) do

   

   for itemIndex, item in pairs (player.Backpack:GetChildren()) do

     

      if (item.Name == "Gun" and item:IsA("Tool")) then

         

         if (item.context.Value == "criminal") then

             

            hRp.CFrame = player.Character.HumanoidRootPart.CFrame

            game:GetService("ReplicatedStorage").remoteInterface.jobs.arrestPlayer:InvokeServer(player)

            game:GetService("ReplicatedStorage").remoteInterface.jobs.arrestPlayer:InvokeServer(player)

            game:GetService("ReplicatedStorage").remoteInterface.jobs.arrestPlayer:InvokeServer(player)

            wait()


         end

         

      end

       

   end

   

end


AUTO TICKET CARS



Code:

for nodeIndex, node in pairs (workspace.jobInstances.police.ticketCarsNodes:GetChildren()) do

   

   game:GetService("ReplicatedStorage").remoteInterface.jobs.action:InvokeServer(node)

   

end


Also this is an updated version of yesterdays post, credits to this user.  Exclamation


Code:

local plr = game.Players.LocalPlayer

local plrChar = plr.Character

local hRP = plrChar.HumanoidRootPart


local heistNumber = 1


while heistNumber < 19 do


 for vIndex ,vItem in pairs (game:GetService("Workspace").jobInstances.criminal.heists:FindFirstChild(heistNumber):GetChildren()) do

      spawn(function()

         if (vItem:IsA("Part")) then

           

             local attempts = 10

           

             while attempts > 0 do

               

                 wait()

           

                 for i ,v in pairs (vItem:GetChildren()) do

                   

                     local mFound = false

               

                     if v:IsA("Model") then

                       

                         mFound = true

                       

                     end

                   

                     if mFound == true then

                       

                         print(vItem.Name)

                         game:GetService("ReplicatedStorage").remoteInterface.jobs.action:InvokeServer(vItem,1)

                       

                     end

                   

                 end

               

                 attempts = attempts - 1

                   

             end

           

         end


     end)


 end


 heistNumber = heistNumber + 1  


end

Previous Post Next Post