Running a Lua Script Without Being In-game/Studio

Hi, I have a webhook script. It only works when I’m in-game or testing in studio. I’m wondering if there’s any way I can run it without being on my computer 24/7. Here’s the script:

local url = "test" --- I didn't want to leak the webhook
local h = game:GetService("HttpService")

while true do
	local badge = math.random(2124451678, 2124451678) ---Insert Random Numbers Here
	local data = {
		
		['embeds'] = {{ 
			
			['title'] = "Badge Bot",
			
			['description'] = "https://roblox.com/badges/"..badge,
			
			['color'] = 6008455,
			
			
			
		}}
		
	}
	
	local finaldata = h:JSONEncode(data)
	h:PostAsync(url, finaldata)
	wait(100) 
end

If there’s some sort of website that allows me to run this script, please let me know. I’m not 100% sure it’s possible. Thanks.

To run code in-game that isn’t already in a script needs loadstring or some other compiler. If you take a look at the Adonis source code, you can find a custom compiler used for the :s and :ls commands. You’ll then need to make some sort of web server that gets constantly polled for new code to run.

1 Like

Could you leave it running in studio in a VPS like Microsoft Azure? (Keep running it in studio).
(It’s probably going to be more efficient to run it in another programming language…)

Roblox APIs like PostAsync are only really compatible with Roblox, so needs to be ran within Roblox.

It’s possible “Cloud Scripts” might provide this kind of functionality.

2 Likes