Jump to content

Search the Community

Showing results for tags 'environment'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. I've edited bonsai's script wrapper and using it, it looks like this: local env = {} local _createObject = createObject local _setTimer = setTimer local _addEventHandler = addEventHandler outputChatBox = function() end triggerServerEvent = function() end createObject = function(...) local object = _createObject(...) setElementDimension(object, dimension) table.insert(wrapper.objects, object) return object end function newClientEnvironment() env = table.copy(_G, true) local metatable = { __index = function(self, index) return rawget(_G, index) end, __newindex = function(_G, index, value) rawset(_G, index, value) end } setmetatable(env, metatable) _outputChatBox('created new Environment') end and this is how a script is loaded: function loadScript(scriptData) local loaded = loadstring(scriptData) setfenv(loaded, env) local ex = pcall(loaded) end The problem is the functions re-defined above interfere with my main script that is using this wrapper. i can just use this wrapper as a separate script but then i'll have to reload two scripts rather than 1, and i dont want that. any ideas? and thank you for reading
×
×
  • Create New...