Advertisement
Nosssa

Block ALL Players Script | UNIVERSAL

Oct 21st, 2022
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.36 KB | None | 0 0
  1. --// Block_All_Players_Script
  2.  
  3. local Players = game:GetService("Players")
  4. local LocalPlayer = Players.LocalPlayer
  5.  
  6. local HttpRbxApiService = game:GetService("HttpRbxApiService")
  7. local RobloxReplicatedStorage = game:GetService("RobloxReplicatedStorage")
  8. local UpdatePlayerBlockListRemote = RobloxReplicatedStorage:FindFirstChild("UpdatePlayerBlockList")
  9.  
  10. function PlayerToBeBlocked(UserData)
  11.     if UserData and LocalPlayer ~= UserData then
  12.         local UserIdToBeBlocked = UserData.UserId
  13.         if UserIdToBeBlocked > 0 then
  14.             UpdatePlayerBlockListRemote:FireServer(UserIdToBeBlocked, true)
  15.             local Success, Blocked = pcall(function()
  16.                 local Pathpoint = "userblock/block"
  17.                 local Param = "userId=" .. tostring(UserData.UserId)
  18.                 local request = HttpRbxApiService:PostAsync(Pathpoint, Param, Enum.ThrottlingPriority.Default, Enum.HttpContentType.ApplicationUrlEncoded)
  19.                 local response = request and game:GetService("HttpService"):JSONDecode(request)
  20.                 return response and response.success
  21.             end)
  22.             return Success and Blocked
  23.         end
  24.     end
  25.     return false
  26. end
  27.  
  28. function PlayerToBeUnBlocked(UserData)
  29.     if UserData then
  30.         local UserIdToBeUnblocked = UserData.UserId
  31.         UpdatePlayerBlockListRemote:FireServer(UserIdToBeUnblocked, false)
  32.         local Success, Unblocked = pcall(function()
  33.             local Pathpoint = "userblock/unblock"
  34.             local Param = "userId=" .. tostring(UserData.UserId)
  35.             local request = HttpRbxApiService:PostAsync(Pathpoint, Param, Enum.ThrottlingPriority.Default, Enum.HttpContentType.ApplicationUrlEncoded)
  36.             local response = request and game:GetService("HttpService"):JSONDecode(request)
  37.             return response and response.success
  38.         end)
  39.         return Success and Unblocked
  40.     end
  41.     return false
  42. end
  43.  
  44. function FetchPlayersAndSetToBeBlocked()
  45.     for _, v in pairs(Players:GetPlayers()) do
  46.         if v ~= LocalPlayer then
  47.             PlayerToBeBlocked(v)
  48.         end
  49.     end
  50. end
  51.  
  52. function SetToUnblockPlayers()
  53.     for _, v in pairs(Players:GetPlayers()) do
  54.         if v ~= LocalPlayer then
  55.             PlayerToBeUnBlocked(v)
  56.         end
  57.     end
  58. end
  59.  
  60. --// Jam_Low_CD
  61. local BaseCoolDown = (.5)
  62.  
  63. local BlockJamAllPlayers = function()
  64.     FetchPlayersAndSetToBeBlocked()
  65.     task.wait(BaseCoolDown)
  66.     SetToUnblockPlayers()  
  67. end
  68.  
  69. function JamBlocker()
  70.     task.spawn(function()
  71.         pcall(function()
  72.             while task.wait(BaseCoolDown) do
  73.                 BlockJamAllPlayers()
  74.             end
  75.         end)
  76.     end)
  77. end coroutine.wrap(JamBlocker)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement