• Need Help with Resource.addfile
    3 replies, posted
What do I name the file and where do I put it.thats all I need to know. and how do I make the file with this [code]//This requires the "Sourceforts Model Pack" //Models for the 3d 1*2 block resource.AddFile("models/sf/block_3d_1x2.mdl") resource.AddFile("models/sf/block_3d_1x2.phy") resource.AddFile("models/sf/block_3d_1x2.dx80.vtx") resource.AddFile("models/sf/block_3d_1x2.dx90.vtx") resource.AddFile("models/sf/block_3d_1x2.sw.vtx") resource.AddFile("models/sf/block_3d_1x2.vvd") //SourceForts Materials resource.AddFile("materials/models/sf_block_black.vmt") resource.AddFile("materials/models/SF_Block_Blue.vmt") resource.AddFile("materials/models/SF_Block_Blue_lod1.vmt") resource.AddFile("materials/models/sf_block_gib_crosssection.vmt") resource.AddFile("materials/models/sf_block_metal.vmt") resource.AddFile("materials/models/sf_block_metal_lod1.vmt") resource.AddFile("materials/models/sf_block_red.vmt") resource.AddFile("materials/models/sf_block_red_lod1.vmt") resource.AddFile("materials/models/SF_Block_Black.vtf") resource.AddFile("materials/models/sf_block_blue.vtf") resource.AddFile("materials/models/sf_block_blue_lod1.vtf") resource.AddFile("materials/models/sf_block_gib_crosssection.vtf") resource.AddFile("materials/models/SF_Block_Metal.vtf") resource.AddFile("materials/models/SF_Block_Metal_Normal.vtf") resource.AddFile("materials/models/SF_Block_Normal.vtf") resource.AddFile("materials/models/SF_Block_Normal_lod1.vtf") resource.AddFile("materials/models/sf_block_red.vtf") resource.AddFile("materials/models/sf_block_red_lod1.vtf")[/code] and this [code]function AddDir(dir) // recursively adds everything in a directory to be downloaded by client local list = file.FindDir("../"..dir.."/*") for _, fdir in pairs(list) do if fdir != ".svn" then // don't spam people with useless .svn folders AddDir(fdir) end end for k,v in pairs(file.Find("../"..dir.."/*")) do resource.AddFile(dir.."/"..v) end end AddDir("models/yourmodels")[/code]
is it for a gamemode or addon? Gamemode = garrysmod\gamemodes\base\gamemode\res.lua the file name can be whatever you want Addon = garrysmod\addons\my Addon\lua\autorun\res.lua this file can be named what ever you want [editline]06:39PM[/editline] if its a gamemode you will need to add [lua] include("res.lua") [/lua] in init.lua in most cases
put it in autorun. eg C:\Program Files\Steam\steamapps\username\garrysmod\garrysmod\lua\autorun call it anything.
yes
Sorry, you need to Log In to post a reply to this thread.