Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- geturlasset - An improved version of synurlasset (pastebin.com/bWzYk6Lh0)
- This adds support for other exploits and pre-caches all files
- ]]
- local cache = {}
- if isfolder("temp") then
- for i,v in pairs(listfiles("temp")) do
- cache[v] = readfile(v)
- end
- end
- local getcustomasset = getsynasset or getcustomasset
- local b64encode = syn.crypt.base64.encode or crypt.base64encode or base64.encode
- function geturlasset(url)
- local eurl = b64encode(url)
- if cache[eurl] then return cache[eurl] end
- local file = "temp/" .. tostring(os.time()) .. ".png"
- makefolder("temp")
- writefile(file, game:HttpGet(url, true))
- local asset = getcustomasset(file)
- cache[eurl] = asset
- return asset
- end
- return geturlasset
Add Comment
Please, Sign In to add comment