• Lua problems with FastDL, some questions.
    0 replies, posted
In my lua/autorun/server folder I have files that will load their respective playermodels. Such as "MTheif_PM_FastDL.lua" and "GFreeman_PM_FastDL.lua" Here are the contents MTheif_PM_FastDL.lua: [lua] local ClientResources = 0; local function ProcessFolder ( Location ) for k, v in pairs(file.Find(Location .. '*')) do if file.IsDir(Location .. v) then ProcessFolder(Location .. v .. '/') else local OurLocation = string.gsub(Location .. v, '../addons/Rorschach_player/', '') if !string.find(Location, '.db') then ClientResources = ClientResources + 1; resource.AddFile(OurLocation); end end end end if !SinglePlayer() then ProcessFolder('../addons/Rorschach_player/materials'); ProcessFolder('../addons/Rorschach_player/models'); end [/lua] And here is GFreeman_PM_FastDL.lua [lua] local ClientResources = 0; local function ProcessFolder ( Location ) for k, v in pairs(file.Find(Location .. '*')) do if file.IsDir(Location .. v) then ProcessFolder(Location .. v .. '/') else local OurLocation = string.gsub(Location .. v, '../addons/gordonplayermodel/', '') if !string.find(Location, '.db') then ClientResources = ClientResources + 1; resource.AddFile(OurLocation); end end end end if !SinglePlayer() then ProcessFolder('../addons/gordonplayermodel/materials'); ProcessFolder('../addons/gordonplayermodel/models'); end [/lua] The addons are in the addon folder. But the websync for my sever puts them in the main garrysmod folder on the fastdl page. Here are pictures from ingame (Keep in mind for this test I deleted the Master Theif model form my client folder): MTheif: [url]http://steamcommunity.com/id/Charrax/screenshot/595840436549569300?tab=public[/url] (So I dont take up your page!) Gordon: [url]http://steamcommunity.com/id/Charrax/screenshot/595840436549568778/?tab=public[/url] (Yet again so I dont take up your page)
Sorry, you need to Log In to post a reply to this thread.