Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- warn("Loading Banland 1.0 by realmaster42...")
- local serialize
- local network = {}
- local pi = math.pi
- local cos = math.cos
- local sin = math.sin
- local acos = math.acos
- local asin = math.asin
- local atan2 = math.atan2
- local random = math.random
- local v3 = Vector3.new
- local totalasd = 0
- local starttick = tick()
- local off = 48
- local function newbitwriter(key)
- key = key and key % 2251799813685248 or 0
- local char = string.char
- local concat = table.concat
- local data = {}
- local ndata = 0
- local rem = 0
- local nrem = 0
- return function(nbits, bits)
- if nbits < 32 then
- bits = (bits + key) % 2 ^ nbits
- else
- local bits0 = bits % 4294967296
- local bits1 = (bits - bits0) / 4294967296
- bits0 = (bits0 + key) % 4294967296
- bits1 = (bits1 + key) % 2 ^ (nbits - 32)
- bits = bits0 + 4294967296 * bits1
- end
- while nrem + nbits >= 48 do
- local r = bits % 2 ^ (48 - nrem)
- bits = (bits - r) / 2 ^ (48 - nrem)
- nbits = nbits - (48 - nrem)
- rem = rem + r * 2 ^ nrem
- local b0 = rem % 64
- rem = (rem - b0) / 64
- local b1 = rem % 64
- rem = (rem - b1) / 64
- local b2 = rem % 64
- rem = (rem - b2) / 64
- local b3 = rem % 64
- rem = (rem - b3) / 64
- local b4 = rem % 64
- rem = (rem - b4) / 64
- local b5 = rem % 64
- rem = (rem - b5) / 64
- local b6 = rem % 64
- rem = (rem - b6) / 64
- local b7 = rem % 64
- rem = (rem - b7) / 64
- rem = 0
- nrem = 0
- ndata = ndata + 1
- data[ndata] = char(b0 + off, b1 + off, b2 + off, b3 + off, b4 + off, b5 + off, b6 + off, b7 + off)
- end
- rem = rem + bits * 2 ^ nrem
- nrem = nrem + nbits
- end, function()
- if nrem ~= 0 then
- local final = ""
- for i = 1, 8 do
- local b = rem % 64
- rem = (rem - b) / 64
- final = final .. char(b + off)
- end
- ndata = ndata + 1
- data[ndata] = final
- end
- return concat(data)
- end
- end
- local type = type
- local pcall = pcall
- local tostring = tostring
- local byte = string.byte
- local frexp = math.frexp
- local nan = tostring(0 / 0)
- function serialize(d, key)
- local asd = tick()
- local e = {}
- local m = 0
- local s = {}
- local n = 0
- local w, x = newbitwriter(key)
- local userdata = {
- function(v)
- local t0 = v.Dot
- return {
- v.x,
- v.y,
- v.z
- }
- end,
- function(v)
- return {
- v:components()
- }
- end,
- function(v)
- return v.UserId
- end
- }
- local function f(d)
- local t = type(d)
- if s[d] then
- w(3, 0)
- local a, b = frexp(s[d])
- w(5, b)
- w(b, s[d])
- elseif t == "boolean" then
- w(3, 1)
- w(1, d and 1 or 0)
- elseif t == "number" then
- if d % 1 == 0 and d > -4294967296 and d < 4294967296 then
- w(3, 2)
- local a, b = frexp(d)
- w(5, b)
- w(1, d < 0 and 1 or 0)
- w(b, d < 0 and -d or d)
- else
- w(3, 3)
- if d ~= d then
- if tostring(d) == nan then
- w(1, 0)
- else
- w(1, 1)
- end
- w(11, 0)
- w(52, 1)
- elseif d == 1 / 0 or d == -1 / 0 then
- w(1, d < 0 and 1 or 0)
- w(11, 2047)
- w(52, 4503599627370495)
- else
- w(1, d < 0 and 1 or 0)
- local a, b = frexp(d < 0 and -d or d)
- local c = (2 * a - 1) * 4503599627370496
- w(11, b - 1 + 1023)
- if b == 1025 and c == 4503599627370495 then
- w(52, (2 * a - 1) * 4503599627370496 - 1)
- else
- w(52, (2 * a - 1) * 4503599627370496)
- end
- end
- end
- elseif t == "string" then
- n = n + 1
- s[d] = n
- w(3, 4)
- local a, b = frexp(#d)
- w(5, b)
- w(b, #d)
- for i = 1, #d do
- local v = byte(d, i)
- w(8, v)
- end
- elseif t == "table" then
- n = n + 1
- s[d] = n
- w(3, 5)
- local j = 0
- local k = 0
- for i = 1, #d do
- if not d[i] then
- j = i - 1
- break
- end
- end
- for i, v in next, d, nil do
- local t = type(i)
- if t ~= "number" or i > j then
- k = k + 1
- end
- end
- local a, b = frexp(j)
- w(5, b)
- w(b, j)
- local a, b = frexp(k)
- w(5, b)
- w(b, k)
- for i = 1, j do
- f(d[i])
- end
- for i, v in next, d, nil do
- local t = type(i)
- if t ~= "number" or i > j then
- f(i)
- f(v)
- end
- end
- else
- local u = false
- for i = 1, #userdata do
- local a, b = pcall(userdata[i], d)
- if a and b then
- w(3, 6)
- w(5, i)
- f(b)
- u = true
- break
- end
- end
- if not u then
- m = m + 1
- e[m] = d
- w(3, 7)
- local a, b = frexp(m)
- w(5, b)
- w(b, m)
- end
- end
- end
- f(d)
- local out = x()
- totalasd = tick() - asd
- return out, e
- end
- print("Preparing network send")
- local tick = tick
- local player = game:GetService("Players").LocalPlayer
- local remoteevent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
- local bounceevent = game.ReplicatedStorage:WaitForChild("BounceEvent")
- local remotefunc = game.ReplicatedStorage:WaitForChild("RemoteFunction")
- local fireserver = remoteevent.FireServer
- local invokeserver = remotefunc.InvokeServer
- local key = 1
- local funcs = {}
- local queue = {}
- local getfenv = getfenv
- local pcall = pcall
- local rawget = rawget
- local settings = settings
- function network:add(name, func)
- funcs[name] = func
- if queue[name] then
- for i = 1, #queue[name] do
- func(unpack(queue[name][i]))
- end
- end
- end
- local function getkey()
- key = 94906230 * key % 94906249
- return key
- end
- function network:send(name, ...)
- return fireserver(remoteevent, serialize({
- name = name,
- ...
- }, getkey()))
- end
- print("Testing")
- wait(5)
- network:send("changehealthx", nil, tick(), -100, "xdxdxd", game:service('Players').LocalPlayer.Character.HumanoidRootPart, game:service('Players').LocalPlayer.Character.HumanoidRootPart.Position)
- print("Done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement