Jump to content

Loading scripts.


denny199

Recommended Posts

Posted

Hey there,

I've started a new project but I can't figure something out.

How can I load lua files for only the player itself without calling it from the resource with exports and calling.

I've heard something about loadstring, but I don't know if I need to use that.

Or do I need to use the fileOpen, fileWrite, etc.. functions?

I will be pleasured when somebody can help me out ;-)

Regards,

Danny

Sometimes I dream about cheese

Posted

and how could I use loadstring from a another resource?

example

The loadstring function will be in "resources/danny/lol.lua"

and then it will load a string from; "resources/gamemode/loading.lua"

BTW, it needs to be downloaded to the "loading.lua"

Sometimes I dream about cheese

Posted

Yes.

It might look like "idea stealing".

But I only want to make this for another gamemodes, not race =,=.

So, what do I need to use?

Sometimes I dream about cheese

Posted
local file = fileOpen( ":resource/file.ext" ); 
if ( file ) then 
    loadstring( fileRead( file, fileGetSize( file ) ) )(); 
end 
fileClose( file ); 

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...