Request keeps declining on normal roblox servers, fine on dev servers

  1. What do you want to achieve? making a fully working part that streams my screen and displays it :grin:

  2. What is the issue? it works fine in roblox studio but errors on roblox server

  3. What solutions have you tried so far? looked everywhere, to be honest,

When I run my game on a normal roblox server the part doesn’t seem to make pixels because it declined the request coming from localhost 1111.

roblox development server:

roblox server:

idk why this happens but i think roblox blacklisted localhost 1111 from accessing vs code.

script:

http = game:GetService("HttpService")

function GetPixels()
	local message = "request pixels"
	http:PostAsync("http://localhost:1111/test", message,Enum.HttpContentType.ApplicationUrlEncoded)
	local data = http:GetAsync("http://localhost:1111/test")
	return http:JSONDecode(data)
end

function ClearPixels()
	for index, pixel in ipairs(game.Workspace.Screen.SurfaceGui:GetChildren()) do
		if pixel.Name == "Clone" then
			pixel:Destroy()
		end
	end
end

function MakePixels()
	
	local pixels = {game.Workspace.Screen.SurfaceGui.Frame}
	
	local colors = GetPixels()
	
	local dataIndex = 1
	
	ClearPixels()
	for y = 1, 101, 1 do		
		for x = 1, 100, 1 do
			local pixel = pixels[#pixels]:Clone()

			pixel.Name = "Clone"

			pixel.Parent = game.Workspace.Screen.SurfaceGui

			pixel.Position = UDim2.new(pixel.Position.X.Scale + 0.01, 0, pixel.Position.Y.Scale, 0)

			pixel.BorderColor3 = Color3.fromRGB(tonumber(colors[dataIndex][1]), tonumber(colors[dataIndex][2]), tonumber(colors[dataIndex][3]))

			table.insert(pixels, pixel)
			dataIndex += 1
		end
		local pixel = pixels[#pixels]:Clone()
		pixel.Name = "Clone"
		pixel.Parent = game.Workspace.Screen.SurfaceGui
		pixel.Position = UDim2.new(pixels[1].Position.X.Scale, 0, pixel.Position.Y.Scale + 0.01, 0)
		pixel.BorderColor3 = Color3.fromRGB(tonumber(colors[dataIndex][1]), tonumber(colors[dataIndex][2]), tonumber(colors[dataIndex][3]))
		table.insert(pixels, pixel)
		dataIndex += 1
	end
end

while true do
	MakePixels()
end

python code:

from flask import Flask, render_template, request
import PIL
import os
import pyautogui
import time

from math import sqrt
value = sqrt(50)

newlist = [i**2 for i in range(1, 100) if i%2==0]

newlist = []

for word in "wordlist":
    newlist.append(word.upper())

app = Flask(__name__)

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/test', methods=['POST', 'GET'])
def test():
    if request.method == 'GET':
        data = str(GetPixelColors())
        return data
    return render_template('index.html')

def GetPixelColors():
    colors = []
    screenshot = pyautogui.screenshot()
    screenshot.save("ss.png")
    
    img = PIL.Image.open("ss.png")
    img = img.resize((101, 102))
    img.show
    pixels = img.load()
    
    for y in range(102):
        for x in range(101):
            color = []
            color.insert(0, pixels[x, y][0])
            color.insert(1, pixels[x, y][1])
            color.insert(2, pixels[x, y][2])
            colors.insert(len(colors)-1, color)
    os.remove("ss.png")
    return colors

#print(GetPixelColors())
app.run(host='0.0.0.0',port='1111',debug=False)

any thoughts or solutions?

:face_with_raised_eyebrow:

You can only send / receive requests using local host from your local network (specifically your local computer). This is why it works in studio but not on a live Roblox server.

You would need to start messing around with opening ports and firewalls and things to make this work on a live server. I would not recommend this as it would be a security vulnerability to your whole local network.

1 Like

Additional to that, other person also made the same thing before, he got banned pretty quickly. You shouldnt use it ingame at all.

k but I plan to do it on a alt account

Yea, telling that you are going to violate TOS on an alt account in the game’s official forum is such a great idea.

1 Like

yeah im only doing it for myself just for fun, not showing my stuff to my friends, etc.