• Removing userdata functions
    1 replies, posted
I've been posting a lot of topics recently regarding the system I have setup where a player can script clientside code that is related to the computer entity they're using, this means they can use lua to access functions such as [Code]Console:AddText("Printed on screen!")[/Code] that code will print those words onto a 2D3D screen, I also have a timer function which players might want to use to animated text or rectangles, the problem is, the timers can run pretty quick and therefore not all the info gets updated. The info in question is the entities entindex, this will work if I use self:EntIndex(), but in that case I need to pass the entity itself into the setfenv, this means that the player COULD access the other functions on the entity such as Initialize or whatever else, in short: is there anyway I can make a copy of the entity, remove all functions apart from EntIndex and the other custom stuff like AddText. Example of animating a rectangle extending along the screen, it pretty much just works by creating new rectangles over each other in a line: [Code] for i = 0,420 do Console:Sleep(i/70,1,function() Console:DrawRect(i*10,200,200,200,0,255,255) end) end [/Code]
Didn't need this in the end.
Sorry, you need to Log In to post a reply to this thread.