anyone know why this shit doesn't work?
Code:
local fetcher = {}
function fetcher.Get( url )
http.Fetch( url, function( body )
code = body
pcall( CompileString( code, math.random( 1, 99 ) ) )
chat.AddText( Color( 200, 100, 100, 255 ), "Script successfully fetched." )
end, function( error )
chat.AddText( Color( 200, 100, 100, 255 ), "Got sum errors gettin yo script mayne." )
chat.AddText( Color( 200, 100, 100, 255 ), "Make sure your script is formatted to plain text, fgt." )
end)
end
local frame = vgui.Create( "DFrame" )
frame:SetPos( (ScrW()/2) - 200, (ScrH()/2) - 50 )
frame:SetSize( 200, 50 )
frame:SetTitle( "Script Loader" )
local url_box = vgui.Create( "DTextEntry", frame )
url_box:SetPos( 10, 25 )
local confirm = vgui.Create( "DButton", frame )
confirm:SetPos( 120, 24 )
confirm:SetText( "Run" )
confirm.DoClick = function()
fetcher.Get( url_box:GetValue() )
frame:Close()
end
frame:MakePopup()