Jump to content

loadstring


Recommended Posts

Posted
You need to define the sound element in in a variable then use destroyElement...

how to define it with compiled file

you can't ,

but ithink if you used , loop for the element sound , you can destory it ,

Posted
It's the same thing again... redefine the function and keep the handlers in a table then run through it and remove them.

he can't becuase the script is compiled , i dont think it's his ,

he should use loop for sounds , then destroy it ,

Posted
He's using loadstring... you can replace any function you want... that's how lua works you know. I did this myself so i know..

compiled files

Edit any thing will make it not work..

Posted
local soundElements = {} 
local _playSound = playSound 
  
function playSound ( ... ) 
  
    local sound = _playSound ( ... ) 
  
    if sound then 
         table.insert ( soundElements, sound ) 
    end 
  
    return sound 
  
end 
  
loadstring ( codeThatCallsplaySound ) () 

Or in a sandbox:

local soundElements = {} 
local env = deepcopy ( _G ) 
  
function env.playSound ( ... ) 
  
    local sound = playSound ( ... ) 
  
    if sound then 
        table.insert ( soundElements, sound ) 
    end 
  
    return sound 
  
end 
  
local func = loadstring ( codeThatCallsplaySound ) 
setfenv ( func, env ) 
func () 

The implementation of deepcopy can be found here.

Posted
He's using loadstring... you can replace any function you want... that's how lua works you know. I did this myself so i know..

compiled files

Edit any thing will make it not work..

Then you simply dont know Lua... look at ixjf's post and learn.

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