Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- geturlasset by dd493
- A URL wrapper for getsynasset.
- Documentation:
- - geturlasset(string url)
- Returns a Content string using the given URL.
- Updates:
- 1.0 Release
- ]]
- local cache = {}
- function geturlasset(url)
- if cache[url] then return cache[url] end
- local file = "temp/" .. tostring(os.time()) .. ".png"
- makefolder("temp")
- writefile(file, game:HttpGet(url, true))
- local asset = getsynasset(file)
- cache[url] = asset
- return asset
- end
- return geturlasset
Advertisement
Add Comment
Please, Sign In to add comment