Advertisement
timmie140

BSS api

Nov 27th, 2024 (edited)
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.93 KB | None | 0 0
  1. local ver = 2
  2.  
  3. local xlp = {
  4. log = function(text)
  5. print(text)
  6. end,
  7.  
  8. div = function(v1, v2)
  9. if v2 == 0 then error("Division by zero") end
  10. return v1 / v2
  11. end,
  12.  
  13. humanoidrootpart = function()
  14. return game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
  15. end,
  16.  
  17. humanoid = function()
  18. return game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
  19. end,
  20.  
  21. tween = function(time, pos)
  22. local hrp = xlp.humanoidrootpart()
  23. if hrp then
  24. local tween = game:GetService("TweenService"):Create(hrp, TweenInfo.new(time, Enum.EasingStyle.Linear), {CFrame = pos})
  25. tween:Play()
  26. task.wait(time)
  27. end
  28. end,
  29.  
  30. walkTo = function(v3)
  31. local humanoid = xlp.humanoid()
  32. if humanoid then
  33. humanoid:MoveTo(v3)
  34. end
  35. end,
  36.  
  37. notify = function(title, description, duration)
  38. pcall(function()
  39. game.StarterGui:SetCore("SendNotification", {
  40. Title = title;
  41. Text = description;
  42. Duration = duration;
  43. })
  44. end)
  45. end,
  46.  
  47. isSynapse = function()
  48. return syn ~= nil
  49. end,
  50.  
  51. isKrnl = function()
  52. return Krnl ~= nil
  53. end,
  54.  
  55. tableVReturn = function(tbl)
  56. for i, v in pairs(tbl) do
  57. print(i, v)
  58. end
  59. end,
  60.  
  61. nickname = game.Players.LocalPlayer.Name,
  62. ver = ver,
  63. placeid = game.PlaceId,
  64. placeversion = game.PlaceVersion,
  65.  
  66. plrico = function(userid)
  67. return "https://www.roblox.com/headshot-thumbnail/image?userId="..userid.."&width=420&height=420&format=png"
  68. end,
  69.  
  70. lplrid = game.Players.LocalPlayer.UserId,
  71.  
  72. getsitebody = function(link)
  73. local success, response = pcall(function()
  74. return syn.request({Url = link, Method = "GET"})
  75. end)
  76. return success and response.Body or nil
  77. end,
  78.  
  79. killroblox = function()
  80. game:Shutdown()
  81. end,
  82.  
  83. rmagnitude = function(v1, v2)
  84. return (v1 - v2).Magnitude
  85. end,
  86.  
  87. varExchange = function(v, v2)
  88. return v2, v
  89. end,
  90.  
  91. enabled = true,
  92. player = game.Players.LocalPlayer,
  93. camera = function()
  94. return game:GetService("Workspace").Camera
  95. end,
  96.  
  97. search = {
  98. byName = function(a, b)
  99. for _, v in pairs(a:GetDescendants()) do
  100. if v.Name == b then
  101. return v
  102. end
  103. end
  104. warn("Can't find object")
  105. end,
  106.  
  107. byMaterial = function(a, b, c)
  108. local size = c or math.huge
  109. local objects = {}
  110. for _, v in pairs(a:GetDescendants()) do
  111. if v:IsA(b) then
  112. table.insert(objects, v)
  113. if #objects == size then
  114. return objects
  115. end
  116. end
  117. end
  118. warn("Can't find object")
  119. end
  120. },
  121.  
  122. childTable = function(path)
  123. return path:GetChildren()
  124. end,
  125.  
  126. afunc = function(f)
  127. local wa = coroutine.create(f)
  128. coroutine.resume(wa)
  129. end,
  130.  
  131. getclosestpart = function(path, t)
  132. local root = xlp.humanoidrootpart()
  133. if not root then return end
  134.  
  135. local closestPart, minDist = nil, math.huge
  136. for _, obj in ipairs(path:GetDescendants()) do
  137. if obj:IsA('BasePart') then
  138. local distance = (root.Position - obj.Position).Magnitude
  139. if distance < minDist then
  140. closestPart, minDist = obj, distance
  141. end
  142. end
  143. end
  144. return closestPart
  145. end,
  146.  
  147. getsmallestpart = function(path, typee, magnitude)
  148. typee = typee or "BasePart"
  149. magnitude = magnitude or math.huge
  150.  
  151. local root = xlp.humanoidrootpart()
  152. if not root then return end
  153.  
  154. local smallestPart, minSize = nil, Vector3.new(math.huge, math.huge, math.huge)
  155. for _, obj in ipairs(path:GetDescendants()) do
  156. if obj:IsA(typee) then
  157. local size = obj.Size
  158. if size.X < minSize.X and size.Y < minSize.Y and (obj.Position - root.Position).Magnitude < magnitude then
  159. smallestPart, minSize = obj, size
  160. end
  161. end
  162. end
  163. return smallestPart
  164. end,
  165.  
  166. generaterandomstring = function(length)
  167. local chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'
  168. local str = ''
  169. for i = 1, length do
  170. str = str .. chars:sub(math.random(1, #chars), math.random(1, #chars))
  171. end
  172. return str
  173. end,
  174.  
  175. request = syn and syn.request or http and http.request or http_request or httprequest or request,
  176.  
  177. pathfindserv = game:GetService('PathfindingService'),
  178.  
  179. toHMS = function(t)
  180. local hours = math.floor(t / 3600)
  181. t = t % 3600
  182. local minutes = math.floor(t / 60)
  183. t = t % 60
  184. return string.format("%02i:%02i:%02i", hours, minutes, t)
  185. end,
  186.  
  187. tablefind = function(tbl, val)
  188. for i, v in pairs(tbl) do
  189. if v == val then
  190. return i
  191. end
  192. end
  193. end,
  194.  
  195. suffixstring = function(num)
  196. local suffixes = {"k", "m", "b", "t", "q", "Q", "sx", "sp", "o", "n", "d"}
  197. for i = #suffixes, 1, -1 do
  198. local threshold = 10 ^ (i * 3)
  199. if num >= threshold then
  200. return string.format("%.1f", num / threshold) .. suffixes[i]
  201. end
  202. end
  203. return tostring(num)
  204. end,
  205.  
  206. teleport = function(cf)
  207. local hrp = xlp.humanoidrootpart()
  208. if hrp then
  209. hrp.CFrame = cf
  210. end
  211. end,
  212.  
  213. findvalue = function(tbl, value)
  214. if type(tbl) == "table" then
  215. for _, v in pairs(tbl) do
  216. if v == value then
  217. return true
  218. end
  219. end
  220. end
  221. return false
  222. end,
  223.  
  224. webhook = function(hook, color, title, description)
  225. pcall(function()
  226. local embed = {
  227. color = color,
  228. title = title,
  229. description = description
  230. }
  231.  
  232. (syn and syn.request or http_request) {
  233. Url = hook,
  234. Method = 'POST',
  235. Headers = {['Content-Type'] = 'application/json'},
  236. Body = game:GetService('HttpService'):JSONEncode({embeds = {embed}})
  237. }
  238. end)
  239. end,
  240.  
  241. returnvalue = function(tbl, val)
  242. for i, v in pairs(tbl) do
  243. if string.match(val, v) then
  244. return v
  245. end
  246. end
  247. return nil
  248. end,
  249.  
  250. pathfind = function(target)
  251. local PathfindingService = xlp.pathfindserv
  252. local humanoid = xlp.humanoid()
  253. local root = xlp.humanoidrootpart()
  254. if not humanoid or not root then return end
  255.  
  256. local path = PathfindingService:CreatePath({
  257. AgentCanJump = true,
  258. WaypointSpacing = 1
  259. })
  260. path:ComputeAsync(root.Position, target)
  261. local waypoints = path:GetWaypoints()
  262. for _, waypoint in ipairs(waypoints) do
  263. humanoid:MoveTo(waypoint.Position)
  264. humanoid.MoveToFinished:wait()
  265. if waypoint.Action == Enum.PathWaypointAction.Jump then
  266. humanoid.Jump = true
  267. end
  268. end
  269. end,
  270.  
  271. getcpnew = function(path)
  272. local closest
  273. for _, v in next, path:GetChildren() do
  274. if not closest or (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - v.Position).magnitude < (closest.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude then
  275. closest = v
  276. end
  277. end
  278. return closest
  279. end,
  280.  
  281. getcpfrompart = function(path, part)
  282. local closest
  283. for _, v in next, path:GetChildren() do
  284. if v:IsA("MeshPart") or v:IsA("Part") then
  285. if not closest or (part.Position - v.Position).magnitude < (closest.Position - part.Position).magnitude then
  286. closest = v
  287. end
  288. end
  289. end
  290. return closest
  291. end,
  292.  
  293. partwithnamepart = function(name, path)
  294. for _, v in next, path:GetChildren() do
  295. if v.Name:match(name) then
  296. return v
  297. end
  298. end
  299. end,
  300.  
  301. getbiggestmodel = function(path)
  302. local biggest
  303. for _, v in next, path:GetChildren() do
  304. if not biggest or #v:GetDescendants() > #biggest:GetDescendants() then
  305. biggest = v
  306. end
  307. end
  308. return biggest
  309. end
  310. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement