local HttpService = game:GetService("HttpService") local Players =…
- User
local HttpService = game:GetService("HttpService") local Players = game:GetService("Players")
local function testHttp() local success, result = pcall(HttpService.GetAsync, HttpService, "https://www.roblox.com/") if success then for _, player in Players:GetPlayers() do player:Kick("WARNING! HTTP Services are enabled, which means that your messages or your join / leave activity are probably getting LOGGED! You've been kicked and informed for the sake of your privacy.") end else if result ~= "Http requests are not enabled. Enable via game settings" then for _, player in Players:GetPlayers() do player:Kick("WARNING! HTTP Services are enabled, which means that your messages or your join / leave activity are probably getting LOGGED! You've been kicked and informed for the sake of your privacy.") end end end end
while true do testHttp() task.wait(10) end
if the result is "Http requests are not enabled. Enable via game settings" then this code should stop
- Assistant
You can improve your script to handle the specific scenario where HTTP requests are disabled and then halt the execution if it detects that the requests are not enabled. Here is the modified script to address your requirements:
local HttpService = game:GetService("HttpService") local Players = game:GetService("Players") local function testHttp() local success, result = pcall(HttpService.GetAsync, HttpService, "https://www.roblox.com/") if success then for _, player in Players:GetPlayers() do player:Kick("WARNING! HTTP Services are enabled, which means that your messages or your join / leave activity are probably getting LOGGED! You've been kicked and informed for the sake of your privacy.") end else if result == "Http requests are not enabled. Enable via game settings" then print("HTTP requests are not enabled. Stopping the script.") return false -- Return false to indicate the requests are not enabled. else for _, player in Players:GetPlayers() do player:Kick("WARNING! HTTP Services are enabled, which means that your messages or your join / leave activity are probably getting LOGGED! You've been kicked and informed for the sake of your privacy.") end end end return true -- Return true to continue the script. end while true do local continue = testHttp() if not continue then break -- Break the loop if the HTTP requests are not enabled. end task.wait(10) end
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.