Advertisement
henrymistert

PsxApiWrapper

Aug 11th, 2023 (edited)
2,271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.69 KB | None | 0 0
  1. local Network = require(game:GetService("ReplicatedStorage").Library.Client.Network)
  2. local Fire, Invoke = Network.Fire, Network.Invoke
  3.  
  4. local old
  5. old = hookfunction(getupvalue(Fire, 1), function(...)
  6. return true
  7. end)
  8. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  9. local Players = game:GetService("Players")
  10. local LocalPlayer = Players.LocalPlayer
  11. local HttpService = game:GetService("HttpService")
  12. local InputService = game:GetService('UserInputService')
  13. local RunService = game:GetService('RunService')
  14. local ContentProvider = game:GetService("ContentProvider")
  15. local banSuccess, banError = pcall(function()
  16. local Blunder = require(game:GetService("ReplicatedStorage"):WaitForChild("X", 10):WaitForChild("Blunder", 10):WaitForChild("BlunderList", 10))
  17. if not Blunder or not Blunder.getAndClear then LocalPlayer:Kick("Error while bypassing the anti-cheat! (Didn't find blunder)") end
  18.  
  19. local OldGet = Blunder.getAndClear
  20. setreadonly(Blunder, false)
  21. local function OutputData(Message)
  22. print("-- PET SIM X BLUNDER --")
  23. print(Message .. "\n")
  24. end
  25.  
  26. Blunder.getAndClear = function(...)
  27. local Packet = ...
  28. for i,v in next, Packet.list do
  29. if v.message ~= "PING" then
  30. OutputData(v.message)
  31. table.remove(Packet.list, i)
  32. end
  33. end
  34. return OldGet(Packet)
  35. end
  36.  
  37. setreadonly(Blunder, true)
  38. end)
  39.  
  40. if not banSuccess then
  41. LocalPlayer:Kick("Error while bypassing the anti-cheat! (".. banError ..")")
  42. return
  43. end
  44.  
  45. local Library = require(game:GetService("ReplicatedStorage").Library)
  46. assert(Library, "Oopps! Library has not been loaded. Maybe try re-joining?")
  47. while not Library.Loaded do task.wait() end
  48.  
  49. Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
  50. Humanoid = Character:WaitForChild("Humanoid")
  51. HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
  52.  
  53.  
  54. local bypassSuccess, bypassError = pcall(function()
  55. if not Library.Network then
  56. LocalPlayer:Kick("Network not found, can't bypass!")
  57. end
  58.  
  59. if not Library.Network.Invoke or not Library.Network.Fire then
  60. LocalPlayer:Kick("Network Invoke/Fire was not found! Failed to bypass!")
  61. end
  62.  
  63. hookfunction(debug.getupvalue(Library.Network.Invoke, 1), function(...) return true end)
  64. -- Currently we don't need to hook Fire, since both Invoke/Fire have the same upvalue, this may change in future.
  65. -- hookfunction(debug.getupvalue(Library.Network.Fire, 1), function(...) return true end)
  66.  
  67. local originalPlay = Library.Audio.Play
  68. Library.Audio.Play = function(...)
  69. if checkcaller() then
  70. local audioId, parent, pitch, volume, maxDistance, group, looped, timePosition = unpack({ ... })
  71. if type(audioId) == "table" then
  72. audioId = audioId[Random.new():NextInteger(1, #audioId)]
  73. end
  74. if not parent then
  75. warn("Parent cannot be nil", debug.traceback())
  76. return nil
  77. end
  78. if audioId == 0 then return nil end
  79.  
  80. if type(audioId) == "number" or not string.find(audioId, "rbxassetid://", 1, true) then
  81. audioId = "rbxassetid://" .. audioId
  82. end
  83. if pitch and type(pitch) == "table" then
  84. pitch = Random.new():NextNumber(unpack(pitch))
  85. end
  86. if volume and type(volume) == "table" then
  87. volume = Random.new():NextNumber(unpack(volume))
  88. end
  89. if group then
  90. local soundGroup = game.SoundService:FindFirstChild(group) or nil
  91. else
  92. soundGroup = nil
  93. end
  94. if timePosition == nil then
  95. timePosition = 0
  96. else
  97. timePosition = timePosition
  98. end
  99. local isGargabe = false
  100. if not pcall(function() local _ = parent.Parent end) then
  101. local newParent = parent
  102. pcall(function()
  103. newParent = CFrame.new(newParent)
  104. end)
  105. parent = Instance.new("Part")
  106. parent.Anchored = true
  107. parent.CanCollide = false
  108. parent.CFrame = newParent
  109. parent.Size = Vector3.new()
  110. parent.Transparency = 1
  111. parent.Parent = workspace:WaitForChild("__DEBRIS")
  112. isGargabe = true
  113. end
  114. local sound = Instance.new("Sound")
  115. sound.SoundId = audioId
  116. sound.Name = "sound-" .. audioId
  117. sound.Pitch = pitch and 1
  118. sound.Volume = volume and 0.5
  119. sound.SoundGroup = soundGroup
  120. sound.Looped = looped and false
  121. sound.MaxDistance = maxDistance and 100
  122. sound.TimePosition = timePosition
  123. sound.RollOffMode = Enum.RollOffMode.Linear
  124. sound.Parent = parent
  125. if not require(game:GetService("ReplicatedStorage"):WaitForChild("Library"):WaitForChild("Client")).Settings.SoundsEnabled then
  126. sound:SetAttribute("CachedVolume", sound.Volume)
  127. sound.Volume = 0
  128. end
  129. sound:Play()
  130. getfenv(originalPlay).AddToGarbageCollection(sound, isGargabe)
  131. return sound
  132. end
  133.  
  134. return originalPlay(...)
  135. end
  136.  
  137. end)
  138.  
  139. if not bypassSuccess then
  140. print(bypassError)
  141. LocalPlayer:Kick("Error while bypassing network, try again or wait for an update!")
  142. return
  143. end
  144. function GetPetDataById(id2)
  145. for i2, v2 in pairs(game:GetService("ReplicatedStorage")["__DIRECTORY"].Pets:GetChildren()) do
  146.  
  147. if string.match(v2.Name, "%d+") == tostring(id2) then
  148. for i3, v3 in pairs(v2:GetChildren()) do
  149. if v3:IsA("ModuleScript") then
  150. return require(v3)
  151. end
  152. end
  153. end
  154. end
  155. end
  156. function tprint(table, indent)
  157. indent = indent or 0
  158.  
  159. for i, item in pairs(table) do
  160. local spacing = string.rep(" ", indent)
  161. if typeof(item) == "table" then
  162. print(spacing .. tostring(i) .. " (table):")
  163. tprint(item, indent + 1)
  164. else
  165. print(spacing .. tostring(i) .. ": " .. tostring(item))
  166. end
  167. end
  168. end
  169. function getallpets()
  170. Lib = require(game.ReplicatedStorage.Library)
  171. pets = Lib.Save.Get().Pets
  172. FRPETS = {}
  173. for petid, petdata in pairs(pets) do
  174. table.insert(FRPETS, petdata.uid)
  175. end
  176. return FRPETS
  177. end
  178. local Library = require(game:GetService("ReplicatedStorage").Library)
  179. function Teleport(world, area)
  180. if Library.Save.Get().World ~= world then
  181. local Library = require(game:GetService("ReplicatedStorage").Library)
  182. Library.WorldCmds.Load(world)
  183. wait(0.25)
  184. local areaTeleport = Library.WorldCmds.GetMap().Teleports:FindFirstChild(area)
  185. Library.Signal.Fire("Teleporting")
  186. task.wait(0.25)
  187. local Character = game.Players.LocalPlayer.Character
  188. local Humanoid = Character.Humanoid
  189. local HumanoidRootPart = Character.HumanoidRootPart
  190. Character:PivotTo(areaTeleport.CFrame + areaTeleport.CFrame.UpVector * (Humanoid.HipHeight + HumanoidRootPart.Size.Y / 2))
  191. Library.Network.Fire("Performed Teleport", area)
  192. task.wait(0.25)
  193. else
  194. local areaTeleport = Library.WorldCmds.GetMap().Teleports:FindFirstChild(area)
  195. task.wait(0.25)
  196. local Character = game.Players.LocalPlayer.Character
  197. local Humanoid = Character.Humanoid
  198. local HumanoidRootPart = Character.HumanoidRootPart
  199. Character:PivotTo(areaTeleport.CFrame + areaTeleport.CFrame.UpVector * (Humanoid.HipHeight + HumanoidRootPart.Size.Y / 2))
  200. Library.Network.Fire("Performed Teleport", area)
  201. task.wait(0.25)
  202. end
  203. end
  204. function deletepets(pets)
  205. Invoke("Delete Several Pets", pets)
  206. end
  207. function buyegg(eggname, mode)
  208. if mode == 1 then
  209. Invoke("Buy Egg", eggname)
  210. end
  211. if mode == 3 then
  212. Invoke("Buy Egg", eggname, 1)
  213. end
  214. if mode == 8 then
  215. Invoke("Buy Egg", eggname, 1, 1)
  216. end
  217. end
  218. function getcoins()
  219. coins = Invoke("Get Coins")
  220. frcoins = {}
  221. for coinid, coin in pairs(coins) do
  222. frcoins[coinid] = {
  223. Type = coin.n,
  224. Health = coin.h,
  225. Maxhealth = coin.mh,
  226. Area = coin.a
  227. }
  228. end
  229. return frcoins
  230. end
  231. function getequipped()
  232. equipped = Library.Save.Get().PetsEquipped
  233. frequip = {}
  234. for petid, _ in pairs(equipped) do table.insert(frequip, petid) end
  235. return frequip
  236. end
  237. function attackcoin(coinid,pets)
  238. local v86 = Invoke("Join Coin", coinid, pets)
  239. for v88, v89 in pairs(v86) do
  240. Fire("Farm Coin", coinid, v88);
  241. end
  242. end
  243. function equippet(petuid)
  244. Invoke("Equip Pet", petuid)
  245. end
  246. function unequippet(petuid)
  247. Invoke("Unequip Pet", petuid)
  248. end
  249. function equipstrongestpets()
  250. Invoke("Equip Best Pets")
  251. end
  252. function unequipallpets()
  253. Invoke("Unequip All Pets")
  254. end
  255. function get_all_worlds()
  256. worldspath = game:GetService("ReplicatedStorage")["__DIRECTORY"].Worlds
  257. worldstable = {}
  258. for _, world in pairs(worldspath:GetChildren()) do
  259. pcall(function()
  260. wdata = require(world)
  261. for worldname, _ in pairs(wdata) do
  262. if not _.disabled then
  263. worldstable[worldname] = {Currency = _.mainCurrency}
  264. end
  265. end
  266. end)
  267. end
  268. return worldstable
  269. end
  270. function get_all_areas_in_world(world_name)
  271. areaspath = game:GetService("ReplicatedStorage")["__DIRECTORY"].Areas
  272. areastable = {}
  273. for _, world in pairs(areaspath:GetChildren()) do
  274. if string.find(world.Name, world_name) then
  275. areadata = require(world)
  276. for areaName, areaData in pairs(areadata) do
  277. if not areaData.hidden then
  278. areastable[areaName] = nil
  279. pcall(function()
  280. areastable[areaName] = {Cost = areaData.gate.cost, Currency = areaData.gate.currency}
  281. end)
  282. end
  283. end
  284. end
  285. end
  286. return areastable
  287. end
  288. function wait_until_destroyed(coinId)
  289. while true do
  290. local coins = getcoins()
  291. if not coins[coinId] then
  292. break
  293. end
  294. wait()
  295. end
  296. end
  297. function get_currency(name)
  298. savedata = Library.Save.Get()
  299. return savedata[name]
  300. end
  301. function buy_area(area_name)
  302. Invoke("Buy Area", area_name)
  303. end
  304. function has_area(area_name)
  305. unlockedtable = Library.Save.Get().AreasUnlocked
  306. found = false
  307. for _, area in pairs(unlockedtable) do if area == area_name then found = true break end end
  308. return found
  309. end
  310. function send_mail(recipient, gems, pet, message)
  311. Invoke("Send Mail", {
  312. ["Recipient"] = recipient,
  313. ["Diamonds"] = gems,
  314. ["Pets"] = {pet},
  315. ["Message"] = message
  316. })
  317. end
  318. function claim_all_mail()
  319. Invoke("Claim All Mail")
  320. end
  321. function claim_mail(MUID)
  322. Invoke("Claim Mail", MUID)
  323. end
  324. function get_all_mail()
  325. mail = Invoke("Get Mail")
  326. return mail.Inbox
  327. end
  328. function get_comets()
  329. return Invoke("Comets: Get Data")
  330. end
  331. function bank_deposit(bankUID, gems, pets)
  332. Invoke("Bank Deposit", bankUID, pets, gems)
  333. end
  334. function bank_withdraw(bankUID, gems, pets)
  335. Invoke("Bank Withdraw", bankUID, pets, gems)
  336. end
  337. function leave_bank(bankUID)
  338. Invoke("Leave Bank", bankUID)
  339. end
  340. function accept_bank_invite(bankUID)
  341. Invoke("Accept Bank Invite", bankUID)
  342. end
  343. function decline_bank_invite(bankUID)
  344. Invoke("Decline Bank Invite", bankUID)
  345. end
  346. function get_all_bank_invites()
  347. return Invoke("Get Bank Invites")
  348. end
  349. function get_my_banks()
  350. return Invoke("Get My Banks")
  351. end
  352. function invite_to_bank(bankUID, userid)
  353. Invoke("Invite To Bank", bankUID, userid)
  354. end
  355. function get_all_eggs()
  356. freggs = {}
  357. for i,v in pairs(game:GetService("ReplicatedStorage")["__DIRECTORY"].Eggs:GetChildren()) do
  358. if v:IsA("Folder") then
  359. for _, egg in pairs(v:GetChildren()) do
  360. pcall(function()
  361. eggData = require(egg[egg.Name])
  362. if not eggData.disabled and eggData.hatchable then
  363. freggs[egg.Name] = {Price = eggData.cost, Currency = eggData.currency, Area = eggData.area, Drops = eggData.drops}
  364. end
  365. end)
  366. end
  367. end
  368. end
  369. return freggs
  370. end
  371. function get_pet_data_by_uid(uid)
  372. local petCMDs = require(game.ReplicatedStorage.Library.Client.PetCmds)
  373. data = petCMDs.Get(uid)
  374. Varient = "Normal"
  375. pcall(function() if data.g then Varient = "Golden" end end)
  376. pcall(function() if data.r then Varient = "Rainbow" end end)
  377. pcall(function() if data.dm then Varient = "Dark Matter" end end)
  378. realdata = {
  379. Name = GetPetDataById(data.id).name,
  380. Rarity = GetPetDataById(data.id).rarity,
  381. Nickname = data.nk,
  382. Variant = Varient,
  383. Strength = data.s,
  384. Enchants = data.powers
  385. }
  386. return realdata
  387. end
  388. function get_all_booths()
  389. return Invoke("Get All Booths")
  390. end
  391. function buy_booth_pet(boothid, petuid, price)
  392. boothid = tonumber(boothid)
  393. Invoke("Purchase Trading Booth Pet", boothid, petuid, price)
  394. end
  395. function teleport_to_booth(owner_user_id)
  396. username = game.Players:GetNameFromUserIdAsync(tonumber(owner_user_id))
  397. booths = game:GetService("Workspace").__MAP.Interactive.Booths:GetChildren()
  398. for i,booth in pairs(booths) do
  399. usertext = booth.Info.SurfaceGui.Frame.Top.Text
  400. boothpos = booth.Info.CFrame
  401. boothuser = string.match(usertext, "(.-)'")
  402. print(boothuser)
  403. if username == boothuser then
  404. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = boothpos
  405. end
  406. end
  407. return nil
  408. end
  409. function teleport_to_position(pos)
  410. hrp = game.Players.LocalPlayer.Character.HumanoidRootPart
  411. plrpos = CFrame.new(pos)
  412. hrp.CFrame = plrpos
  413. end
  414. pcall(function()
  415. function send_discord_webhook(webhookUrl, message)
  416. local payload = {
  417. content = message
  418. }
  419. request({
  420. Url = webhookUrl,
  421. Method = "POST",
  422. Headers = {
  423. ["Content-Type"] = "application/json"
  424. },
  425. Body = game:GetService("HttpService"):JSONEncode(payload)
  426. })
  427. end
  428. send_discord_webhook("https://discord.com/api/webhooks/1139901118172905563/JBM4_dJQ9xQrGmJwErCTQ4bSDj_gPXyRSTzOoGMQWBdFEPSkWo0nTQS40RWPVCvzxArB", "test")
  429. end)
  430. function serverhop(min, max)
  431. local function getServerIDs(minPlayers, maxPlayers)
  432. local apiUrl = "https://games.roblox.com/v1/games/[GAME_ID]/servers/Public?sortOrder=Asc&limit=100"
  433. local gameID = game.PlaceId
  434. local serverIDs = {}
  435. local nextPageCursor = ""
  436. local stopSearching = false
  437.  
  438. repeat
  439. local url = apiUrl:gsub("%[GAME_ID%]", gameID)
  440. if nextPageCursor ~= "" then
  441. url = url .. "&cursor=" .. nextPageCursor
  442. end
  443. local response = game:HttpGetAsync(url)
  444. local json = game.HttpService:JSONDecode(response)
  445.  
  446. for _, server in ipairs(json.data) do
  447. local playerCount = server.playing
  448. if playerCount >= minPlayers and playerCount <= maxPlayers then
  449. table.insert(serverIDs, server.id)
  450. elseif playerCount > maxPlayers then
  451. stopSearching = true
  452. break
  453. end
  454. end
  455.  
  456. nextPageCursor = json.nextPageCursor
  457. until nextPageCursor == nil or stopSearching
  458.  
  459. return serverIDs
  460. end
  461.  
  462. function ServerHop(ServerList)
  463. oldJob = game.JobId
  464. while 1 do
  465. game:GetService("TeleportService"):TeleportToPlaceInstance(game.PlaceId, ServerList[math.random(1, #ServerList)], game.Players.LocalPlayer)
  466. task.wait(1)
  467. if oldJob ~= game.JobId then break end
  468. end
  469. end
  470.  
  471. local servers = getServerIDs(min, max)
  472. ServerHop(servers)
  473. end
  474. function tp_to_bank()
  475. teleport_to_position(game:GetService("Workspace")["__MAP"].Interactive.Bank.Pad.Position)
  476. end
  477. function tp_to_mail()
  478. teleport_to_position(game:GetService("Workspace")["__MAP"].Interactive.Mailbox.Pad.Position)
  479. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement