Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local patch = [[local IsT = game.IsA
- local disabledE = {
- ["Player"] = {
- ["kick"] = true;
- ["remove"] = true;
- ["destroy"] = true;
- }
- }
- local readOnly = {
- ["Player"] = {
- ["parent"] = true;
- }
- }
- local isBoxed = {}
- local type=type
- local pairs=pairs
- local sandboxInstance
- local function sandbox(...)
- local dus = {...}
- for _,inst in next,dus do
- if isBoxed[inst] then
- dus[_] = inst
- else
- local newBox
- if type(inst) == "userdata" then
- if rawequal(pcall(IsT,inst,'Instance')) then
- newBox = sandboxInstance(inst)
- end
- elseif type(inst) == "table" then
- newBox = sandbox(unpack(inst))
- end
- if newBox then
- isBoxed[newBox] = inst
- dus[_] = newBox
- end
- end
- end
- return unpack(dus)
- end
- function sandboxInstance(inst)
- local er, cName = pcall(function() return inst.ClassName end)
- local mp = newproxy(true)
- local tab = getmetatable(mp)
- function tab:__tostring()
- return tostring(inst)
- end
- tab.__metatable = getmetatable(inst)
- function tab:__index(key)
- if disabledE[key:lower()] or (disabledE[cName] and disabledE[cName][key:lower()]) then
- error("Item '" .. key .. "' of " .. cName .. " has been disabled", 2)
- end
- local val = inst[key]
- if type(val) == "function" then
- return function(self, ...)
- return sandbox(val(inst, ...))
- end
- else
- return sandbox(val)
- end
- return val
- end
- function tab:__newindex(key, value)
- if readOnly[key:lower()] or (readOnly[cName] and readOnly[cName][key:lower()]) then
- error("Item '" .. key .. "' of " .. cName .. " is read-only", 2)
- end
- if isBoxed[value] then
- value = isBoxed[value]
- end
- local e, m = pcall(function() inst[key] = value end)
- if e == false then
- error(m, 2)
- end
- end
- return mp
- end
- game = sandbox(game)
- local mnew = Instance.new
- local mInstance = {}
- for i,v in pairs(Instance) do
- mInstance[i] = v
- end
- Instance = mInstance
- Instance.new = function(p,c)
- if isBoxed[c] then
- c = isBoxed[c]
- end
- local suc, e = pcall(mnew, p, c)
- if not suc then
- error(e, 2)
- end
- return sandbox(e)
- end
- ]]
- patch = patch:gsub("\n", " ")
- game.DescendantAdded:connect(function(inst)
- pcall(function()
- if inst.ClassName == "Script" or inst.ClassName == "LocalScript" then
- local val = inst:FindFirstChild("Source") or inst:FindFirstChild("source")
- if val then
- print(val.Value)
- val.Value = patch .. " " .. val.Value
- end
- end
- end)
- end)
- -- loadstring(game:service("HttpService"):GetAsync("http://pastebin.com/raw.php?i=k8TwMhsj"))()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement