In-Game Script Loader

Posts 14 of 4 · Page 1 of 1
In-Game Script Loader
This might give some people ideas.

Code:
function theloader(player,cmd,args)
	local truepath = "vinci/"..args[1]
	if file.Exists(truepath,"GAME") then
		local contents = file.Read(truepath,"GAME")
		assert(CompileString( contents, tostring(math.random()) ))()
	else
		Msg("File not found.")
	end
end

function theautocomplete()
	local thelist = {}
	local list = file.Find("vinci/*.lua","GAME")
	for _, f in pairs(list) do
		table.insert(thelist,"vinci_load "..f)
	end
	return thelist
end



concommand.Add( "vinci_load", theloader, theautocomplete )
Auto-complete is skidded. Deal with it.
or make a module that lets you load from anywhere on ur computer
This is how i learn if there was NOTHING public i would be fuck out of luck.
Quote Originally Posted by Axisofaj View Post
Original comment removed and quote cleaned up.
Stop being an enabler, you're ruining it for people that know what they're doing.
If information parties may or may not know was never shared, you wouldn't be using that computer you have right now.
Posts 14 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?