diff --git a/defs.d.lua b/defs.d.lua index 4cb156c..25f668d 100644 --- a/defs.d.lua +++ b/defs.d.lua @@ -10258,6 +10258,10 @@ declare _CHAR_APPEARANCE: string declare _PING_URL: string declare _BASE_URL: string +declare _THUMBNAIL_KEY: string +declare _RENDER_TYPE: string +declare _ASSET_ID: number + declare _MAP_LOCATION_EXISTS: boolean declare _MAP_LOCATION: any declare _SERVER_PORT: number diff --git a/luau/renderAvatar.luau b/luau/renderAvatar.luau index 0653133..a00ee66 100644 --- a/luau/renderAvatar.luau +++ b/luau/renderAvatar.luau @@ -1,14 +1,16 @@ -- Avatar v1.1.0 -- This is the thumbnail script for R6 avatars. Straight up and down, with the right arm out if they have a gear. -local baseUrl: string = _BASE_URL -local thumbnailKey: string = _THUMBNAIL_KEY -local renderType: string = _RENDER_TYPE -local assetId: number = _ASSET_ID +local baseUrl = _BASE_URL +local thumbnailKey = _THUMBNAIL_KEY +local renderType = _RENDER_TYPE +local assetId = _ASSET_ID local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local ContentProvider = game:GetService "ContentProvider" local InsertService = game:GetService "InsertService" +local HttpService = game:GetService "HttpService" +local ScriptContext = game:GetService "ScriptContext" pcall(function() ContentProvider:SetBaseUrl(baseUrl) @@ -16,8 +18,11 @@ pcall(function() InsertService:SetAssetVersionUrl(baseUrl .. "/Asset/?assetversionid=%d") end) -game:GetService("HttpService").HttpEnabled = true -game:GetService("ScriptContext").ScriptsDisabled = true +HttpService.HttpEnabled = true +ScriptContext.ScriptsDisabled = true + +print(baseUrl, thumbnailKey, renderType, assetId) + print( "[" .. game.JobId @@ -41,6 +46,8 @@ local player = game:GetService("Players"):CreateLocalPlayer(0) player.CharacterAppearance = baseUrl .. "/Asset/CharacterFetch.ashx?userID=" .. assetId + .. "&serverId=-1&t=" + .. tick() player:LoadCharacter(false) -- Raise up the character's arm if they have gear. @@ -50,10 +57,10 @@ if gear then player.Character.Torso["Right Shoulder"].CurrentAngle = math.rad(90) end -local click = ThumbnailGenerator:Click("PNG", 1024, 1024, true) +local click = ThumbnailGenerator:Click("PNG", 420, 420, true) local result = '{"Status": 2, "Click": "' .. tostring(click) .. '"}' -print result +print(result) print("[" .. game.JobId .. "] Successfully rendered, moving on...") while true do @@ -66,8 +73,7 @@ while true do .. game.JobId, result, true, - "text/plain", - true + "text/plain" ) end) if not ok then diff --git a/luau/renderClothing.luau b/luau/renderClothing.luau index 333cdbb..ffbee07 100644 --- a/luau/renderClothing.luau +++ b/luau/renderClothing.luau @@ -1,12 +1,16 @@ -- Avatar v1.1.0 -- This is the thumbnail script for R6 avatars. Straight up and down, with the right arm out if they have a gear. -local baseUrl: string, thumbnailKey: string, renderType: string, assetId: number = - ... +local baseUrl = _BASE_URL +local thumbnailKey = _THUMBNAIL_KEY +local renderType = _RENDER_TYPE +local assetId = _ASSET_ID local ThumbnailGenerator = game:GetService "ThumbnailGenerator" local ContentProvider = game:GetService "ContentProvider" local InsertService = game:GetService "InsertService" +local HttpService = game:GetService "HttpService" +local ScriptContext = game:GetService "ScriptContext" pcall(function() ContentProvider:SetBaseUrl(baseUrl) @@ -14,8 +18,10 @@ pcall(function() InsertService:SetAssetVersionUrl(baseUrl .. "/Asset/?assetversionid=%d") end) -game:GetService("HttpService").HttpEnabled = true -game:GetService("ScriptContext").ScriptsDisabled = true +HttpService.HttpEnabled = true +ScriptContext.ScriptsDisabled = true + +print(baseUrl, thumbnailKey, renderType, assetId) print( "[" @@ -50,10 +56,10 @@ if gear then player.Character.Torso["Right Shoulder"].CurrentAngle = math.rad(90) end -local click = ThumbnailGenerator:Click("PNG", 1024, 1024, true) +local click = ThumbnailGenerator:Click("PNG", 420, 420, true) local result = '{"Status": 2, "Click": "' .. tostring(click) .. '"}' -print result +print(result) print("[" .. game.JobId .. "] Successfully rendered, moving on...") while true do