Jump to content

'compiled' resources


Stratospheria

Recommended Posts

Another interesting method is compiling all client scripts to one file. It's can be done by lua compiler too.

Which Lua compiler

Another interesting method is to script object-oriented.

Since thieves can't understand it I'm pretty sure they will fail at using it.

Example is my anticheat which was stolen but failed completely. It simply killed everybody who joined.

How are you going to realise this?

Link to comment
  • 11 months later...
  • Moderators
Not bumping* just need to know, because this post is inside the tools. viewtopic.php?f=91&t=31891 >How to make client scripts exist only in memory<

Well how do I set up this?

Must the .lua client file that should be read in the meta?

Must this "Client Lua file:" also be in the file that should be read?

Do I need one client file for reading and the other for the script that should be loaded in the memory?

:?

@ Postby Ransom on Tue Feb 08, 2011 4:44 am (page 1)

Server Lua file:

function RecieveScriptFromServer () 
    local file = fileOpen ( 'CLIENTSIDE.lua', true )--This opens the script containing the clientside script inside the resource 
    if file then    
        local packets = {} 
        local counter = 1 
        while not fileIsEOF(file) do              
            packets[counter] = fileRead(file, 30000)--65535 byte send limit per trigger 
            counter = counter + 1 
        end 
        fileClose(file)  
        triggerClientEvent ( "onRequestClientFiles", root, packets) 
    else 
        outputConsole("Client files are missing serverside!") 
    end 
end 
addEvent( "onRecieveScriptFromServer", true ) 
addEventHandler( "onRecieveScriptFromServer", root, RecieveScriptFromServer )    

Client Lua file:

triggerServerEvent ( "onRecieveScriptFromServer", getLocalPlayer() )  
  
function RequestClientFiles (clientCode) 
    append = "" 
    for k,v in ipairs(clientCode) do 
        append = append..v 
    end 
    loadstring(append)() 
end 
addEvent( "onRequestClientFiles", true ) 
addEventHandler( "onRequestClientFiles", root, RequestClientFiles ) 

Link to comment

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