Solvedhttp.Fetch loader

Posts 14 of 4 · Page 1 of 1
http.Fetch loader
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()
Does it say "Script successfully fetched." when you load the correct url?
/Moved to the correct section.
1 week has passed and no further replies have been made by the OP. Assuming solved.

/Closed.
Posts 14 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?