0% found this document useful (0 votes)
236 views1 page

GitHub Loader for Pastefy Scripts

The document is a Lua script designed to load and execute an external script from Pastefy. It includes a random ID generator for logging and execution tags, a function to fetch the script from a specified URL, and a function to run the fetched script. The script handles success and failure cases for both fetching and executing the code.

Uploaded by

jlp.lumawag
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
236 views1 page

GitHub Loader for Pastefy Scripts

The document is a Lua script designed to load and execute an external script from Pastefy. It includes a random ID generator for logging and execution tags, a function to fetch the script from a specified URL, and a function to run the fetched script. The script handles success and failure cases for both fetching and executing the code.

Uploaded by

jlp.lumawag
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

-- GitHub Loader for Pastefy Script

-- Loads external script from Pastefy and executes it

-- Random ID generator
local function makeTag()
return "tag_" .. tostring([Link](100000, 999999))
end

-- Define variables
local pastefyURL = "[Link]
local logTag = makeTag()
local execTag = makeTag()

-- Fetching function
local function fetchFromPastefy(url)
print("[GitHubLoader] Connecting to:", url)
local success, response = pcall(function()
return game:HttpGet(url, true)
end)

if success then
print("[GitHubLoader] Script fetched with tag:", logTag)
return response
else
warn("[GitHubLoader] Failed to fetch script from:", url)
return nil
end
end

-- Run the fetched script


local function runScript(code)
local ok, func = pcall(loadstring, code)
if ok and func then
print("[GitHubLoader] Executing script via tag:", execTag)
return pcall(func)
else
warn("[GitHubLoader] Script execution failed.")
end
end

-- Execute flow
local code = fetchFromPastefy(pastefyURL)
if code then
runScript(code)
else
warn("[GitHubLoader] Cannot run script - fetch failed.")
end

You might also like