Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ver = 2
- local xlp = {
- log = function(text)
- print(text)
- end,
- div = function(v1, v2)
- if v2 == 0 then error("Division by zero") end
- return v1 / v2
- end,
- humanoidrootpart = function()
- return game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
- end,
- humanoid = function()
- return game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
- end,
- tween = function(time, pos)
- local hrp = xlp.humanoidrootpart()
- if hrp then
- local tween = game:GetService("TweenService"):Create(hrp, TweenInfo.new(time, Enum.EasingStyle.Linear), {CFrame = pos})
- tween:Play()
- task.wait(time)
- end
- end,
- walkTo = function(v3)
- local humanoid = xlp.humanoid()
- if humanoid then
- humanoid:MoveTo(v3)
- end
- end,
- notify = function(title, description, duration)
- pcall(function()
- game.StarterGui:SetCore("SendNotification", {
- Title = title;
- Text = description;
- Duration = duration;
- })
- end)
- end,
- isSynapse = function()
- return syn ~= nil
- end,
- isKrnl = function()
- return Krnl ~= nil
- end,
- tableVReturn = function(tbl)
- for i, v in pairs(tbl) do
- print(i, v)
- end
- end,
- nickname = game.Players.LocalPlayer.Name,
- ver = ver,
- placeid = game.PlaceId,
- placeversion = game.PlaceVersion,
- plrico = function(userid)
- return "https://www.roblox.com/headshot-thumbnail/image?userId="..userid.."&width=420&height=420&format=png"
- end,
- lplrid = game.Players.LocalPlayer.UserId,
- getsitebody = function(link)
- local success, response = pcall(function()
- return syn.request({Url = link, Method = "GET"})
- end)
- return success and response.Body or nil
- end,
- killroblox = function()
- game:Shutdown()
- end,
- rmagnitude = function(v1, v2)
- return (v1 - v2).Magnitude
- end,
- varExchange = function(v, v2)
- return v2, v
- end,
- enabled = true,
- player = game.Players.LocalPlayer,
- camera = function()
- return game:GetService("Workspace").Camera
- end,
- search = {
- byName = function(a, b)
- for _, v in pairs(a:GetDescendants()) do
- if v.Name == b then
- return v
- end
- end
- warn("Can't find object")
- end,
- byMaterial = function(a, b, c)
- local size = c or math.huge
- local objects = {}
- for _, v in pairs(a:GetDescendants()) do
- if v:IsA(b) then
- table.insert(objects, v)
- if #objects == size then
- return objects
- end
- end
- end
- warn("Can't find object")
- end
- },
- childTable = function(path)
- return path:GetChildren()
- end,
- afunc = function(f)
- local wa = coroutine.create(f)
- coroutine.resume(wa)
- end,
- getclosestpart = function(path, t)
- local root = xlp.humanoidrootpart()
- if not root then return end
- local closestPart, minDist = nil, math.huge
- for _, obj in ipairs(path:GetDescendants()) do
- if obj:IsA('BasePart') then
- local distance = (root.Position - obj.Position).Magnitude
- if distance < minDist then
- closestPart, minDist = obj, distance
- end
- end
- end
- return closestPart
- end,
- getsmallestpart = function(path, typee, magnitude)
- typee = typee or "BasePart"
- magnitude = magnitude or math.huge
- local root = xlp.humanoidrootpart()
- if not root then return end
- local smallestPart, minSize = nil, Vector3.new(math.huge, math.huge, math.huge)
- for _, obj in ipairs(path:GetDescendants()) do
- if obj:IsA(typee) then
- local size = obj.Size
- if size.X < minSize.X and size.Y < minSize.Y and (obj.Position - root.Position).Magnitude < magnitude then
- smallestPart, minSize = obj, size
- end
- end
- end
- return smallestPart
- end,
- generaterandomstring = function(length)
- local chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'
- local str = ''
- for i = 1, length do
- str = str .. chars:sub(math.random(1, #chars), math.random(1, #chars))
- end
- return str
- end,
- request = syn and syn.request or http and http.request or http_request or httprequest or request,
- pathfindserv = game:GetService('PathfindingService'),
- toHMS = function(t)
- local hours = math.floor(t / 3600)
- t = t % 3600
- local minutes = math.floor(t / 60)
- t = t % 60
- return string.format("%02i:%02i:%02i", hours, minutes, t)
- end,
- tablefind = function(tbl, val)
- for i, v in pairs(tbl) do
- if v == val then
- return i
- end
- end
- end,
- suffixstring = function(num)
- local suffixes = {"k", "m", "b", "t", "q", "Q", "sx", "sp", "o", "n", "d"}
- for i = #suffixes, 1, -1 do
- local threshold = 10 ^ (i * 3)
- if num >= threshold then
- return string.format("%.1f", num / threshold) .. suffixes[i]
- end
- end
- return tostring(num)
- end,
- teleport = function(cf)
- local hrp = xlp.humanoidrootpart()
- if hrp then
- hrp.CFrame = cf
- end
- end,
- findvalue = function(tbl, value)
- if type(tbl) == "table" then
- for _, v in pairs(tbl) do
- if v == value then
- return true
- end
- end
- end
- return false
- end,
- webhook = function(hook, color, title, description)
- pcall(function()
- local embed = {
- color = color,
- title = title,
- description = description
- }
- (syn and syn.request or http_request) {
- Url = hook,
- Method = 'POST',
- Headers = {['Content-Type'] = 'application/json'},
- Body = game:GetService('HttpService'):JSONEncode({embeds = {embed}})
- }
- end)
- end,
- returnvalue = function(tbl, val)
- for i, v in pairs(tbl) do
- if string.match(val, v) then
- return v
- end
- end
- return nil
- end,
- pathfind = function(target)
- local PathfindingService = xlp.pathfindserv
- local humanoid = xlp.humanoid()
- local root = xlp.humanoidrootpart()
- if not humanoid or not root then return end
- local path = PathfindingService:CreatePath({
- AgentCanJump = true,
- WaypointSpacing = 1
- })
- path:ComputeAsync(root.Position, target)
- local waypoints = path:GetWaypoints()
- for _, waypoint in ipairs(waypoints) do
- humanoid:MoveTo(waypoint.Position)
- humanoid.MoveToFinished:wait()
- if waypoint.Action == Enum.PathWaypointAction.Jump then
- humanoid.Jump = true
- end
- end
- end,
- getcpnew = function(path)
- local closest
- for _, v in next, path:GetChildren() do
- if not closest or (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - v.Position).magnitude < (closest.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude then
- closest = v
- end
- end
- return closest
- end,
- getcpfrompart = function(path, part)
- local closest
- for _, v in next, path:GetChildren() do
- if v:IsA("MeshPart") or v:IsA("Part") then
- if not closest or (part.Position - v.Position).magnitude < (closest.Position - part.Position).magnitude then
- closest = v
- end
- end
- end
- return closest
- end,
- partwithnamepart = function(name, path)
- for _, v in next, path:GetChildren() do
- if v.Name:match(name) then
- return v
- end
- end
- end,
- getbiggestmodel = function(path)
- local biggest
- for _, v in next, path:GetChildren() do
- if not biggest or #v:GetDescendants() > #biggest:GetDescendants() then
- biggest = v
- end
- end
- return biggest
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement