Possible fix to the Instance.new issue


  • local Temp = {}
    local tempNew = Instance.new
    Temp.new = function(className, parent)
    	local object = tempNew(className)
    	object.Parent = parent
    	return object
    end
    Instance = Temp
    Temp, TempNew = nil
    

    Would this be a plausible solution to the problem with passing a parent argument into the Instance.new function? I haven't conducted any benchmarking, though in theory, it should work more efficiently.


  • @LateralLace What? That sounds looks like the same thing but with extra steps.


  • For some reason, passing the parent argument into an Instance.new() function causes more lag than defining/setting it afterwards. To work around this, I redefined the function by creating the instance and then setting it's parent.


Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.