Insert Character plugin

All right, here I am.

I’m not a PHP wizard, so please forgive me if this sucks ass. Works, however, to an extent.

[code]<?php

// im not the best with php code, plz spare me

$hash= $_GET[‘avatarHash’];
$id= $_GET[‘serverplaceid’];

file_get_contents(‘http://roblox.com/Asset/BodyColors.ashx?avatarHash=’ . $hash . ‘&serverplaceid=’ . $id, false, stream_context_create(array(‘http’=>array(‘method’ => ‘GET’, ‘header’=> 'Requester: Client\r\nRoblox-Place-Id: ’ . $id . ‘\r\nAccept-Encoding: gzip\r\nUser-Agent: Roblox/WinInet\r\nHost: www.roblox.com\r\nConnection: Keep-Alive\r\n’))));

echo(file_get_contents(‘http://c1.rbxcdn.com/’ . $hash, false, stream_context_create(array(‘http’ => array(‘method’ => ‘GET’, ‘header’ => 'Requester: Client\r\nRoblox-Place-Id: ’ . $id . ‘\r\nAccept-Encoding: gzip\r\nUser-Agent: Roblox/WinInet\r\nHost: c1.rbxcdn.com\r\nConnection: Keep-Alive\r\n’)))));

?>[/code]

[code]–[[

Arguments:
userid: an int. selfexplanatory

Returns:
table with BrickColors in it, their names are their respective body parts
–]]

function getBodyColors(userid)
local getHashUrl = ‘http://roproxy.tk/Asset/CharacterFetch.ashx?userId=%d&placeId=’ … game.PlaceId;
local getBCUrl = ‘http://rbot.host56.com/?avatarHash=%s&serverplaceid=’ … game.PlaceId; – You can use your own host. Mine is hosted off of 000webhost
local pickApartRegex = ‘(%d-)’;

local httpService = game:GetService('HttpService');
local returnTable = { };

for partName, colorId in httpService:GetAsync(getBCUrl:format(httpService:GetAsync(getHashUrl:format(userid)):match('avatarHash=(.-);'))):gmatch(pickApartRegex) do
	partName = partName:gsub('Color', ''):gsub('Right', 'Right '):gsub('Left', 'Left ');
	table.insert(returnTable, { Name = partName; Color = BrickColor.new(colorId); });
end;

return returnTable;

end;[/code]

You can use it like

bodyColors = getBodyColors(771417); for i, v in next, bodyColors do character:FindFirstChild(v.Name).BrickColor = v.Color; end;

I think this still works. My host was still alive after about 7 months of being abandoned, I found that pretty funny.

Cheers m8o

<?xml version="1.0" encoding="UTF-8"?>

AccessDeniedAccess DeniedB40744C3734DC3F8G4DaNmK0gw5WU5xEcJS7K+sSbhi9/bRhaGNOgDBKMX5n0J5CxvEScjQR0BrV7JLl

I’m guessing this means your server is down? The end result string looked fine to me:
http://rbot.host56.com/?avatarHash=44e06aed562219456c9e4c14e142d554&serverplaceid=0

Roblox needs to continue expanding the AssetService so we can do stuff like this without HttpService hacks.

[quote] <?xml version="1.0" encoding="UTF-8"?>
AccessDeniedAccess DeniedB40744C3734DC3F8G4DaNmK0gw5WU5xEcJS7K+sSbhi9/bRhaGNOgDBKMX5n0J5CxvEScjQR0BrV7JLl

I’m guessing this means your server is down? The end result string looked fine to me:
http://rbot.host56.com/?avatarHash=44e06aed562219456c9e4c14e142d554&serverplaceid=0” [/quote]

It worked with my character appearance hash… That’s really weird. Try tinkering around with it, because it definitely works for me