Steamworks
The snippet can be accessed without any authentication.
Authored by
Maximilian Grüttemeier
Edited
steamworks.lua 1.40 KiB
function UGCWorkshopMount( workshopid )
steamworks.FileInfo( workshopid, function( result )
if not result.installed or result.disabled then
steamworks.DownloadUGC( result.id, function( name, file )
if name then
success, _ = game.MountGMA( name )
if success then
hook.Call( "UGCMountEvent", nil, result.id, result, true )
else
hook.Call( "UGCMountEvent", nil, result.id, result, false )
end
else
hook.Call( "UGCMountEvent", nil, result.id, result, false )
end
end)
end
end)
end
function WorkshopMount( workshopid )
steamworks.FileInfo( workshopid, function( result )
if not result.installed or result.disabled then
steamworks.Download( result.previewid, true, function( name )
if name then
success, _ = game.MountGMA( name )
if success then
hook.Call( "MountEvent", nil, result.id, result, true )
else
hook.Call( "MountEvent", nil, result.id, result, false )
end
else
hook.Call( "MountEvent", nil, result.id, result, false )
end
end)
end
end)
end
Please sign in to comment