generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Advanced newproxy help!

Previous Thread :: Next Thread 
N8X is not online. N8X
Joined: 15 Nov 2013
Total Posts: 1665
23 Nov 2013 10:30 PM
-- I know the code is long but I don't know what I did wrong.
-- [ PROXY SYSTEM ] --
Protected = {"N8X"}
Proxies = {}
Fenv = getfenv()
function Protected:GetProtected(Name)
for i,v in pairs(Protected) do
if Name==v then
return true
end
end
return false
end
function GetData(One)
if type(One)=="userdata" then
return One
elseif type(One)=="table" then
local NewTable = {}
for i,v in next,o do
t[i] = GetData(v)
end
return NewTable
else
return One
end
end
function GetData2(One,Two)
local Get = select("#",Two)
local Get2,Get3 = Two
if c==1 then
return One[Get2]
elseif c==2 then
One[Get2] = GetData(Get3)
end
end
function GetData3(Data)
local Data2 = {}
for i=1,select("#",Data) do
Data[i] = GetData(select(i,Data))
end
return unpack(Data)
end
function ProxyLock(Instance)
if Proxies[Instance] then return Proxies[Instance] end
local Proxy = newproxy(true)
local Metatable = getmetatable(Proxy)
Metatable.__metatable = getmetatable(Instance)
function Metatable:__tostring()
return tostring(Instance)
end
function Metatable:__index(Index)
local Success,Data = pcall(GetData2,Instance,Index)
if not Success then
error(Index.." is not a valid member of "..Instance.ClassName,0)
else
if Protected:GetProtected(Instance.Name) then
return function()
error("Test",0)-- [ Caught you noob ] --
end
end
CheckScan2(Data)
end
end
function Metatable:__newindex(Index,Value)
local Success,Data = pcall(GetData2,Instance,Index,Value)
if not Success then
error(Data,0)
end
end
Proxies[Instance] = Proxy
return Proxy
end

function CheckScan2(Data)
local Data2 = {}
for i=1,select("#",Data) do
Data2[i] = CheckScan(select(i,Data))
end
return unpack(Data2)
end

function CheckScan(Data)
if type(Data)=="userdata" then
if pcall(game.IsA,Data,"Instance") then
return ProxyLock(Data)
else
if tostring(Data):find("Signal")==1 and pcall(GetData2,Data,"connect") then
local NewTable;NewTable = {
wait = function(Self)
return (Self==NewTable and Data and Self):wait()
end;
connect = function(Self,Data2)
Self = Self==NewTable and Data or Self
local Success,Data3 = pcall(Data.connect,Self,function(Data4)
local Success,Data5 = ypcall(function(Data4)
Data2(CheckScan2(Data4))
end,Data4)
if not Success then
error(Data,0)
error(" ",0)
end
end)
if not Success then
error(Data3,0)
end
return{
disconnect = function()
Data:Disconnect()
end
}
end
}
return NewTable
else
return Data
end
end
elseif type(Data)=="table" then
local Copier = {}
for i,v in next,Data do
Copier[CheckScan(i)] = CheckScan(v)
end
return Copier
elseif type(Data)=="function" then
return function(Self,Data6)
return CheckScan2(Data(GetData3(Self,Data6)))
end
end
return res
end
for i,v in ipairs{
{"game,Game",ProxyLock(game)};
{"script,Script",ProxyLock(script)};
{"workspace,Workspace",ProxyLock(workspace)}
}do
for String in v[1]:gmatch("([^,]+)") do
Fenv[String] = v[2]
end
end
wait()
game.Workspace.Name = "Test"-- errors "attempt to index field 'Workspace' (a nil value)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Nov 2013 10:31 PM
I didn't read everything but the first thing I saw wrong after scrolling:

for i,v in ipairs{
...
} do

It should be

for i,v in ipairs(
...
) do
Report Abuse
Excellus is not online. Excellus
Joined: 17 Jun 2013
Total Posts: 3939
23 Nov 2013 10:31 PM
you can't change the name of the workspace
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Nov 2013 10:32 PM
^ Yes you can
Report Abuse
Excellus is not online. Excellus
Joined: 17 Jun 2013
Total Posts: 3939
23 Nov 2013 10:33 PM
don't know, it just seems like a waste of time
Report Abuse
N8X is not online. N8X
Joined: 15 Nov 2013
Total Posts: 1665
23 Nov 2013 10:36 PM
@cntkill
It does not need to be changed

Studio Code Example : for i,v in ipairs{{"LOL","LEL"},{"TROLL","OLL"}} do print(v[1],v[2]) end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Nov 2013 10:37 PM
Can you pastebin your code, with tabs? lol
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
23 Nov 2013 10:38 PM
local NewTable = {}
for i,v in next,o do
t[i] = GetData(v)

t is nil for one
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image