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

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"

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

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...