Menace00

Roblox Anime adventures script

Jul 6th, 2023
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 309.07 KB | None | 0 0
  1. getgenv().hidename = true
  2.  
  3. ---### Loading Section ###---
  4. task.wait(2)
  5. repeat task.wait() until game:IsLoaded()
  6. if game.PlaceId == 8304191830 then
  7. repeat task.wait() until game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)
  8. repeat task.wait() until game.Players.LocalPlayer.PlayerGui:FindFirstChild("collection"):FindFirstChild("grid"):FindFirstChild("List"):FindFirstChild("Outer"):FindFirstChild("UnitFrames")
  9. else
  10. repeat task.wait() until game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name)
  11. game:GetService("ReplicatedStorage").endpoints.client_to_server.vote_start:InvokeServer()
  12. repeat task.wait() until game:GetService("Workspace")["_waves_started"].Value == true
  13. end
  14.  
  15. ---### Loading Section End ###---
  16.  
  17. --[[
  18.  
  19. Rayfield Interface Suite
  20. by Sirius
  21.  
  22. shlex | Designing + Programming
  23. iRay | Programming
  24.  
  25. ]]
  26.  
  27. -- DO NOT MODIFY UNLESS YOU KNOW WHAT YOU ARE DOING - Defrag
  28.  
  29. local Release = "Beta 7R"
  30. local NotificationDuration = 6.5
  31. local RayfieldFolder = "Rayfield"
  32. local ConfigurationFolder = RayfieldFolder.."/Configurations"
  33. local ConfigurationExtension = ".rfld"
  34.  
  35. local RayfieldLibrary = {
  36. Flags = {},
  37. Theme = {
  38. Default = {
  39. TextFont = "Default", -- Default will use the various font faces used across Rayfield
  40. TextColor = Color3.fromRGB(240, 240, 240),
  41.  
  42. Background = Color3.fromRGB(25, 25, 25),
  43. Topbar = Color3.fromRGB(34, 34, 34),
  44. Shadow = Color3.fromRGB(20, 20, 20),
  45.  
  46. NotificationBackground = Color3.fromRGB(20, 20, 20),
  47. NotificationActionsBackground = Color3.fromRGB(230, 230, 230),
  48.  
  49. TabBackground = Color3.fromRGB(80, 80, 80),
  50. TabStroke = Color3.fromRGB(85, 85, 85),
  51. TabBackgroundSelected = Color3.fromRGB(210, 210, 210),
  52. TabTextColor = Color3.fromRGB(240, 240, 240),
  53. SelectedTabTextColor = Color3.fromRGB(50, 50, 50),
  54.  
  55. ElementBackground = Color3.fromRGB(35, 35, 35),
  56. ElementBackgroundHover = Color3.fromRGB(40, 40, 40),
  57. SecondaryElementBackground = Color3.fromRGB(25, 25, 25), -- For labels and paragraphs
  58. ElementStroke = Color3.fromRGB(50, 50, 50),
  59. SecondaryElementStroke = Color3.fromRGB(40, 40, 40), -- For labels and paragraphs
  60.  
  61. SliderBackground = Color3.fromRGB(43, 105, 159),
  62. SliderProgress = Color3.fromRGB(43, 105, 159),
  63. SliderStroke = Color3.fromRGB(48, 119, 177),
  64.  
  65. ToggleBackground = Color3.fromRGB(30, 30, 30),
  66. ToggleEnabled = Color3.fromRGB(0, 146, 214),
  67. ToggleDisabled = Color3.fromRGB(100, 100, 100),
  68. ToggleEnabledStroke = Color3.fromRGB(0, 170, 255),
  69. ToggleDisabledStroke = Color3.fromRGB(125, 125, 125),
  70. ToggleEnabledOuterStroke = Color3.fromRGB(100, 100, 100),
  71. ToggleDisabledOuterStroke = Color3.fromRGB(65, 65, 65),
  72.  
  73. InputBackground = Color3.fromRGB(30, 30, 30),
  74. InputStroke = Color3.fromRGB(65, 65, 65),
  75. PlaceholderColor = Color3.fromRGB(178, 178, 178)
  76. },
  77. Light = {
  78. TextFont = "Gotham", -- Default will use the various font faces used across Rayfield
  79. TextColor = Color3.fromRGB(50, 50, 50), -- i need to make all text 240, 240, 240 and base gray on transparency not color to do this
  80.  
  81. Background = Color3.fromRGB(255, 255, 255),
  82. Topbar = Color3.fromRGB(217, 217, 217),
  83. Shadow = Color3.fromRGB(223, 223, 223),
  84.  
  85. NotificationBackground = Color3.fromRGB(20, 20, 20),
  86. NotificationActionsBackground = Color3.fromRGB(230, 230, 230),
  87.  
  88. TabBackground = Color3.fromRGB(220, 220, 220),
  89. TabStroke = Color3.fromRGB(112, 112, 112),
  90. TabBackgroundSelected = Color3.fromRGB(0, 142, 208),
  91. TabTextColor = Color3.fromRGB(240, 240, 240),
  92. SelectedTabTextColor = Color3.fromRGB(50, 50, 50),
  93.  
  94. ElementBackground = Color3.fromRGB(198, 198, 198),
  95. ElementBackgroundHover = Color3.fromRGB(230, 230, 230),
  96. SecondaryElementBackground = Color3.fromRGB(136, 136, 136), -- For labels and paragraphs
  97. ElementStroke = Color3.fromRGB(180, 199, 97),
  98. SecondaryElementStroke = Color3.fromRGB(40, 40, 40), -- For labels and paragraphs
  99.  
  100. SliderBackground = Color3.fromRGB(31, 159, 71),
  101. SliderProgress = Color3.fromRGB(31, 159, 71),
  102. SliderStroke = Color3.fromRGB(42, 216, 94),
  103.  
  104. ToggleBackground = Color3.fromRGB(170, 203, 60),
  105. ToggleEnabled = Color3.fromRGB(32, 214, 29),
  106. ToggleDisabled = Color3.fromRGB(100, 22, 23),
  107. ToggleEnabledStroke = Color3.fromRGB(17, 255, 0),
  108. ToggleDisabledStroke = Color3.fromRGB(65, 8, 8),
  109. ToggleEnabledOuterStroke = Color3.fromRGB(0, 170, 0),
  110. ToggleDisabledOuterStroke = Color3.fromRGB(170, 0, 0),
  111.  
  112. InputBackground = Color3.fromRGB(31, 159, 71),
  113. InputStroke = Color3.fromRGB(19, 65, 31),
  114. PlaceholderColor = Color3.fromRGB(178, 178, 178)
  115. }
  116. }
  117. }
  118.  
  119. -- Services
  120. local UserInputService = game:GetService("UserInputService")
  121. local TweenService = game:GetService("TweenService")
  122. local HttpService = game:GetService("HttpService")
  123. local RunService = game:GetService("RunService")
  124. local Players = game:GetService("Players")
  125. local CoreGui = game:GetService("CoreGui")
  126.  
  127. -- Interface Management
  128. local Rayfield = game:GetObjects("rbxassetid://10804731440")[1]
  129.  
  130. if gethui then
  131. Rayfield.Parent = gethui()
  132. elseif syn.protect_gui then
  133. syn.protect_gui(Rayfield)
  134. Rayfield.Parent = CoreGui
  135. elseif CoreGui:FindFirstChild("RobloxGui") then
  136. Rayfield.Parent = CoreGui:FindFirstChild("RobloxGui")
  137. else
  138. Rayfield.Parent = CoreGui
  139. end
  140.  
  141. if gethui then
  142. for _, Interface in ipairs(gethui():GetChildren()) do
  143. if Interface.Name == Rayfield.Name and Interface ~= Rayfield then
  144. Interface.Enabled = false
  145. Interface.Name = "Rayfield-Old"
  146. end
  147. end
  148. else
  149. for _, Interface in ipairs(CoreGui:GetChildren()) do
  150. if Interface.Name == Rayfield.Name and Interface ~= Rayfield then
  151. Interface.Enabled = false
  152. Interface.Name = "Rayfield-Old"
  153. end
  154. end
  155. end
  156.  
  157. -- Object Variables
  158.  
  159. local Camera = workspace.CurrentCamera
  160. local Main = Rayfield.Main
  161. local Topbar = Main.Topbar
  162. local Elements = Main.Elements
  163. local LoadingFrame = Main.LoadingFrame
  164. local TabList = Main.TabList
  165.  
  166. Rayfield.DisplayOrder = 100
  167. LoadingFrame.Version.Text = Release
  168.  
  169.  
  170. -- Variables
  171.  
  172. local request = (syn and syn.request) or (http and http.request) or http_request
  173. local CFileName = nil
  174. local CEnabled = false
  175. local Minimised = false
  176. local Hidden = false
  177. local Debounce = false
  178. local Notifications = Rayfield.Notifications
  179.  
  180. local SelectedTheme = RayfieldLibrary.Theme.Default
  181.  
  182. function ChangeTheme(ThemeName)
  183. SelectedTheme = RayfieldLibrary.Theme[ThemeName]
  184. for _, obj in ipairs(Rayfield:GetDescendants()) do
  185. if obj.ClassName == "TextLabel" or obj.ClassName == "TextBox" or obj.ClassName == "TextButton" then
  186. if SelectedTheme.TextFont ~= "Default" then
  187. obj.TextColor3 = SelectedTheme.TextColor
  188. obj.Font = SelectedTheme.TextFont
  189. end
  190. end
  191. end
  192.  
  193. Rayfield.Main.BackgroundColor3 = SelectedTheme.Background
  194. Rayfield.Main.Topbar.BackgroundColor3 = SelectedTheme.Topbar
  195. Rayfield.Main.Topbar.CornerRepair.BackgroundColor3 = SelectedTheme.Topbar
  196. Rayfield.Main.Shadow.Image.ImageColor3 = SelectedTheme.Shadow
  197.  
  198. Rayfield.Main.Topbar.ChangeSize.ImageColor3 = SelectedTheme.TextColor
  199. Rayfield.Main.Topbar.Hide.ImageColor3 = SelectedTheme.TextColor
  200. Rayfield.Main.Topbar.Theme.ImageColor3 = SelectedTheme.TextColor
  201.  
  202. for _, TabPage in ipairs(Elements:GetChildren()) do
  203. for _, Element in ipairs(TabPage:GetChildren()) do
  204. if Element.ClassName == "Frame" and Element.Name ~= "Placeholder" and Element.Name ~= "SectionSpacing" and Element.Name ~= "SectionTitle" then
  205. Element.BackgroundColor3 = SelectedTheme.ElementBackground
  206. Element.UIStroke.Color = SelectedTheme.ElementStroke
  207. end
  208. end
  209. end
  210.  
  211. end
  212.  
  213. local function AddDraggingFunctionality(DragPoint, Main)
  214. pcall(function()
  215. local Dragging, DragInput, MousePos, FramePos = false
  216. DragPoint.InputBegan:Connect(function(Input)
  217. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  218. Dragging = true
  219. MousePos = Input.Position
  220. FramePos = Main.Position
  221.  
  222. Input.Changed:Connect(function()
  223. if Input.UserInputState == Enum.UserInputState.End then
  224. Dragging = false
  225. end
  226. end)
  227. end
  228. end)
  229. DragPoint.InputChanged:Connect(function(Input)
  230. if Input.UserInputType == Enum.UserInputType.MouseMovement then
  231. DragInput = Input
  232. end
  233. end)
  234. UserInputService.InputChanged:Connect(function(Input)
  235. if Input == DragInput and Dragging then
  236. local Delta = Input.Position - MousePos
  237. TweenService:Create(Main, TweenInfo.new(0.45, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Position = UDim2.new(FramePos.X.Scale,FramePos.X.Offset + Delta.X, FramePos.Y.Scale, FramePos.Y.Offset + Delta.Y)}):Play()
  238. end
  239. end)
  240. end)
  241. end
  242.  
  243. local function PackColor(Color)
  244. return {R = Color.R * 255, G = Color.G * 255, B = Color.B * 255}
  245. end
  246.  
  247. local function UnpackColor(Color)
  248. return Color3.fromRGB(Color.R, Color.G, Color.B)
  249. end
  250.  
  251. local function LoadConfiguration(Configuration)
  252. local Data = HttpService:JSONDecode(Configuration)
  253. table.foreach(Data, function(FlagName, FlagValue)
  254. if RayfieldLibrary.Flags[FlagName] then
  255. spawn(function()
  256. if RayfieldLibrary.Flags[FlagName].Type == "ColorPicker" then
  257. RayfieldLibrary.Flags[FlagName]:Set(UnpackColor(FlagValue))
  258. else
  259. if RayfieldLibrary.Flags[FlagName].CurrentValue or RayfieldLibrary.Flags[FlagName].CurrentKeybind or RayfieldLibrary.Flags[FlagName].CurrentOption or RayfieldLibrary.Flags[FlagName].Color ~= FlagValue then RayfieldLibrary.Flags[FlagName]:Set(FlagValue) end
  260. end
  261. end)
  262. else
  263. RayfieldLibrary:Notify({Title = "Flag Error", Content = "Rayfield was unable to find '"..FlagName.. "'' in the current script"})
  264. end
  265. end)
  266. end
  267.  
  268. local function SaveConfiguration()
  269. if not CEnabled then return end
  270. local Data = {}
  271. for i,v in pairs(RayfieldLibrary.Flags) do
  272. if v.Type == "ColorPicker" then
  273. Data[i] = PackColor(v.Color)
  274. else
  275. Data[i] = v.CurrentValue or v.CurrentKeybind or v.CurrentOption or v.Color
  276. end
  277. end
  278. writefile(ConfigurationFolder .. "\\" .. CFileName .. ConfigurationExtension, tostring(HttpService:JSONEncode(Data)))
  279. end
  280.  
  281. local neon = (function() -- Open sourced neon module
  282. local module = {}
  283.  
  284. do
  285. local function IsNotNaN(x)
  286. return x == x
  287. end
  288. local continued = IsNotNaN(Camera:ScreenPointToRay(0,0).Origin.x)
  289. while not continued do
  290. RunService.RenderStepped:wait()
  291. continued = IsNotNaN(Camera:ScreenPointToRay(0,0).Origin.x)
  292. end
  293. end
  294. local RootParent = Camera
  295. if getgenv().SecureMode == nil then
  296. RootParent = Camera
  297. else
  298. if not getgenv().SecureMode then
  299. RootParent = Camera
  300. else
  301. RootParent = nil
  302. end
  303. end
  304.  
  305.  
  306. local binds = {}
  307. local root = Instance.new('Folder', RootParent)
  308. root.Name = 'neon'
  309.  
  310.  
  311. local GenUid; do
  312. local id = 0
  313. function GenUid()
  314. id = id + 1
  315. return 'neon::'..tostring(id)
  316. end
  317. end
  318.  
  319. local DrawQuad; do
  320. local acos, max, pi, sqrt = math.acos, math.max, math.pi, math.sqrt
  321. local sz = 0.2
  322.  
  323. function DrawTriangle(v1, v2, v3, p0, p1)
  324. local s1 = (v1 - v2).magnitude
  325. local s2 = (v2 - v3).magnitude
  326. local s3 = (v3 - v1).magnitude
  327. local smax = max(s1, s2, s3)
  328. local A, B, C
  329. if s1 == smax then
  330. A, B, C = v1, v2, v3
  331. elseif s2 == smax then
  332. A, B, C = v2, v3, v1
  333. elseif s3 == smax then
  334. A, B, C = v3, v1, v2
  335. end
  336.  
  337. local para = ( (B-A).x*(C-A).x + (B-A).y*(C-A).y + (B-A).z*(C-A).z ) / (A-B).magnitude
  338. local perp = sqrt((C-A).magnitude^2 - para*para)
  339. local dif_para = (A - B).magnitude - para
  340.  
  341. local st = CFrame.new(B, A)
  342. local za = CFrame.Angles(pi/2,0,0)
  343.  
  344. local cf0 = st
  345.  
  346. local Top_Look = (cf0 * za).lookVector
  347. local Mid_Point = A + CFrame.new(A, B).LookVector * para
  348. local Needed_Look = CFrame.new(Mid_Point, C).LookVector
  349. local dot = Top_Look.x*Needed_Look.x + Top_Look.y*Needed_Look.y + Top_Look.z*Needed_Look.z
  350.  
  351. local ac = CFrame.Angles(0, 0, acos(dot))
  352.  
  353. cf0 = cf0 * ac
  354. if ((cf0 * za).lookVector - Needed_Look).magnitude > 0.01 then
  355. cf0 = cf0 * CFrame.Angles(0, 0, -2*acos(dot))
  356. end
  357. cf0 = cf0 * CFrame.new(0, perp/2, -(dif_para + para/2))
  358.  
  359. local cf1 = st * ac * CFrame.Angles(0, pi, 0)
  360. if ((cf1 * za).lookVector - Needed_Look).magnitude > 0.01 then
  361. cf1 = cf1 * CFrame.Angles(0, 0, 2*acos(dot))
  362. end
  363. cf1 = cf1 * CFrame.new(0, perp/2, dif_para/2)
  364.  
  365. if not p0 then
  366. p0 = Instance.new('Part')
  367. p0.FormFactor = 'Custom'
  368. p0.TopSurface = 0
  369. p0.BottomSurface = 0
  370. p0.Anchored = true
  371. p0.CanCollide = false
  372. p0.Material = 'Glass'
  373. p0.Size = Vector3.new(sz, sz, sz)
  374. local mesh = Instance.new('SpecialMesh', p0)
  375. mesh.MeshType = 2
  376. mesh.Name = 'WedgeMesh'
  377. end
  378. p0.WedgeMesh.Scale = Vector3.new(0, perp/sz, para/sz)
  379. p0.CFrame = cf0
  380.  
  381. if not p1 then
  382. p1 = p0:clone()
  383. end
  384. p1.WedgeMesh.Scale = Vector3.new(0, perp/sz, dif_para/sz)
  385. p1.CFrame = cf1
  386.  
  387. return p0, p1
  388. end
  389.  
  390. function DrawQuad(v1, v2, v3, v4, parts)
  391. parts[1], parts[2] = DrawTriangle(v1, v2, v3, parts[1], parts[2])
  392. parts[3], parts[4] = DrawTriangle(v3, v2, v4, parts[3], parts[4])
  393. end
  394. end
  395.  
  396. function module:BindFrame(frame, properties)
  397. if RootParent == nil then return end
  398. if binds[frame] then
  399. return binds[frame].parts
  400. end
  401.  
  402. local uid = GenUid()
  403. local parts = {}
  404. local f = Instance.new('Folder', root)
  405. f.Name = frame.Name
  406.  
  407. local parents = {}
  408. do
  409. local function add(child)
  410. if child:IsA'GuiObject' then
  411. parents[#parents + 1] = child
  412. add(child.Parent)
  413. end
  414. end
  415. add(frame)
  416. end
  417.  
  418. local function UpdateOrientation(fetchProps)
  419. local zIndex = 1 - 0.05*frame.ZIndex
  420. local tl, br = frame.AbsolutePosition, frame.AbsolutePosition + frame.AbsoluteSize
  421. local tr, bl = Vector2.new(br.x, tl.y), Vector2.new(tl.x, br.y)
  422. do
  423. local rot = 0;
  424. for _, v in ipairs(parents) do
  425. rot = rot + v.Rotation
  426. end
  427. if rot ~= 0 and rot%180 ~= 0 then
  428. local mid = tl:lerp(br, 0.5)
  429. local s, c = math.sin(math.rad(rot)), math.cos(math.rad(rot))
  430. local vec = tl
  431. tl = Vector2.new(c*(tl.x - mid.x) - s*(tl.y - mid.y), s*(tl.x - mid.x) + c*(tl.y - mid.y)) + mid
  432. tr = Vector2.new(c*(tr.x - mid.x) - s*(tr.y - mid.y), s*(tr.x - mid.x) + c*(tr.y - mid.y)) + mid
  433. bl = Vector2.new(c*(bl.x - mid.x) - s*(bl.y - mid.y), s*(bl.x - mid.x) + c*(bl.y - mid.y)) + mid
  434. br = Vector2.new(c*(br.x - mid.x) - s*(br.y - mid.y), s*(br.x - mid.x) + c*(br.y - mid.y)) + mid
  435. end
  436. end
  437. DrawQuad(
  438. Camera:ScreenPointToRay(tl.x, tl.y, zIndex).Origin,
  439. Camera:ScreenPointToRay(tr.x, tr.y, zIndex).Origin,
  440. Camera:ScreenPointToRay(bl.x, bl.y, zIndex).Origin,
  441. Camera:ScreenPointToRay(br.x, br.y, zIndex).Origin,
  442. parts
  443. )
  444. if fetchProps then
  445. for _, pt in pairs(parts) do
  446. pt.Parent = f
  447. end
  448. for propName, propValue in pairs(properties) do
  449. for _, pt in pairs(parts) do
  450. pt[propName] = propValue
  451. end
  452. end
  453. end
  454. end
  455.  
  456. UpdateOrientation(true)
  457. RunService:BindToRenderStep(uid, 2000, UpdateOrientation)
  458.  
  459. binds[frame] = {
  460. uid = uid;
  461. parts = parts;
  462. }
  463. return binds[frame].parts
  464. end
  465.  
  466. function module:Modify(frame, properties)
  467. local parts = module:GetBoundParts(frame)
  468. if parts then
  469. for propName, propValue in pairs(properties) do
  470. for _, pt in pairs(parts) do
  471. pt[propName] = propValue
  472. end
  473. end
  474. end
  475. end
  476.  
  477. function module:UnbindFrame(frame)
  478. if RootParent == nil then return end
  479. local cb = binds[frame]
  480. if cb then
  481. RunService:UnbindFromRenderStep(cb.uid)
  482. for _, v in pairs(cb.parts) do
  483. v:Destroy()
  484. end
  485. binds[frame] = nil
  486. end
  487. end
  488.  
  489. function module:HasBinding(frame)
  490. return binds[frame] ~= nil
  491. end
  492.  
  493. function module:GetBoundParts(frame)
  494. return binds[frame] and binds[frame].parts
  495. end
  496.  
  497.  
  498. return module
  499.  
  500. end)()
  501.  
  502. function RayfieldLibrary:Notify(NotificationSettings)
  503. spawn(function()
  504. local ActionCompleted = true
  505. local Notification = Notifications.Template:Clone()
  506. Notification.Parent = Notifications
  507. Notification.Name = NotificationSettings.Title or "Unknown Title"
  508. Notification.Visible = true
  509.  
  510. local blurlight = nil
  511. if not getgenv().SecureMode then
  512. blurlight = Instance.new("DepthOfFieldEffect",game:GetService("Lighting"))
  513. blurlight.Enabled = true
  514. blurlight.FarIntensity = 0
  515. blurlight.FocusDistance = 51.6
  516. blurlight.InFocusRadius = 50
  517. blurlight.NearIntensity = 1
  518. game:GetService("Debris"):AddItem(script,0)
  519. end
  520.  
  521. Notification.Actions.Template.Visible = false
  522.  
  523. if NotificationSettings.Actions then
  524. for _, Action in pairs(NotificationSettings.Actions) do
  525. ActionCompleted = false
  526. local NewAction = Notification.Actions.Template:Clone()
  527. NewAction.BackgroundColor3 = SelectedTheme.NotificationActionsBackground
  528. if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  529. NewAction.TextColor3 = SelectedTheme.TextColor
  530. end
  531. NewAction.Name = Action.Name
  532. NewAction.Visible = true
  533. NewAction.Parent = Notification.Actions
  534. NewAction.Text = Action.Name
  535. NewAction.BackgroundTransparency = 1
  536. NewAction.TextTransparency = 1
  537. NewAction.Size = UDim2.new(0, NewAction.TextBounds.X + 27, 0, 36)
  538.  
  539. NewAction.MouseButton1Click:Connect(function()
  540. local Success, Response = pcall(Action.Callback)
  541. if not Success then
  542. print("Rayfield | Action: "..Action.Name.." Callback Error " ..tostring(Response))
  543. end
  544. ActionCompleted = true
  545. end)
  546. end
  547. end
  548. Notification.BackgroundColor3 = SelectedTheme.Background
  549. Notification.Title.Text = NotificationSettings.Title or "Unknown"
  550. Notification.Title.TextTransparency = 1
  551. Notification.Title.TextColor3 = SelectedTheme.TextColor
  552. Notification.Description.Text = NotificationSettings.Content or "Unknown"
  553. Notification.Description.TextTransparency = 1
  554. Notification.Description.TextColor3 = SelectedTheme.TextColor
  555. Notification.Icon.ImageColor3 = SelectedTheme.TextColor
  556. if NotificationSettings.Image then
  557. Notification.Icon.Image = "rbxassetid://"..tostring(NotificationSettings.Image)
  558. else
  559. Notification.Icon.Image = "rbxassetid://3944680095"
  560. end
  561.  
  562. Notification.Icon.ImageTransparency = 1
  563.  
  564. Notification.Parent = Notifications
  565. Notification.Size = UDim2.new(0, 260, 0, 80)
  566. Notification.BackgroundTransparency = 1
  567.  
  568. TweenService:Create(Notification, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 295, 0, 91)}):Play()
  569. TweenService:Create(Notification, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.1}):Play()
  570. Notification:TweenPosition(UDim2.new(0.5,0,0.915,0),'Out','Quint',0.8,true)
  571.  
  572. wait(0.3)
  573. TweenService:Create(Notification.Icon, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  574. TweenService:Create(Notification.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  575. TweenService:Create(Notification.Description, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.2}):Play()
  576. wait(0.2)
  577.  
  578.  
  579.  
  580. -- Requires Graphics Level 8-10
  581. if getgenv().SecureMode == nil then
  582. TweenService:Create(Notification, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.4}):Play()
  583. else
  584. if not getgenv().SecureMode then
  585. TweenService:Create(Notification, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.4}):Play()
  586. else
  587. TweenService:Create(Notification, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  588. end
  589. end
  590.  
  591. if Rayfield.Name == "Rayfield" then
  592. neon:BindFrame(Notification.BlurModule, {
  593. Transparency = 0.98;
  594. BrickColor = BrickColor.new("Institutional white");
  595. })
  596. end
  597.  
  598. if not NotificationSettings.Actions then
  599. wait(NotificationSettings.Duration or NotificationDuration - 0.5)
  600. else
  601. wait(0.8)
  602. TweenService:Create(Notification, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 295, 0, 132)}):Play()
  603. wait(0.3)
  604. for _, Action in ipairs(Notification.Actions:GetChildren()) do
  605. if Action.ClassName == "TextButton" and Action.Name ~= "Template" then
  606. TweenService:Create(Action, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.2}):Play()
  607. TweenService:Create(Action, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  608. wait(0.05)
  609. end
  610. end
  611. end
  612.  
  613. repeat wait(0.001) until ActionCompleted
  614.  
  615. for _, Action in ipairs(Notification.Actions:GetChildren()) do
  616. if Action.ClassName == "TextButton" and Action.Name ~= "Template" then
  617. TweenService:Create(Action, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  618. TweenService:Create(Action, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  619. end
  620. end
  621.  
  622. TweenService:Create(Notification.Title, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Position = UDim2.new(0.47, 0,0.234, 0)}):Play()
  623. TweenService:Create(Notification.Description, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {Position = UDim2.new(0.528, 0,0.637, 0)}):Play()
  624. TweenService:Create(Notification, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 280, 0, 83)}):Play()
  625. TweenService:Create(Notification.Icon, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  626. TweenService:Create(Notification, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.6}):Play()
  627.  
  628. wait(0.3)
  629. TweenService:Create(Notification.Title, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.4}):Play()
  630. TweenService:Create(Notification.Description, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.5}):Play()
  631. wait(0.4)
  632. TweenService:Create(Notification, TweenInfo.new(0.9, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 260, 0, 0)}):Play()
  633. TweenService:Create(Notification, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  634. TweenService:Create(Notification.Title, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  635. TweenService:Create(Notification.Description, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  636. wait(0.2)
  637. if not getgenv().SecureMode then
  638. neon:UnbindFrame(Notification.BlurModule)
  639. blurlight:Destroy()
  640. end
  641. wait(0.9)
  642. Notification:Destroy()
  643. end)
  644. end
  645.  
  646. function Hide()
  647. Debounce = true
  648. RayfieldLibrary:Notify({Title = "Interface Hidden", Content = "The interface has been hidden, you can unhide the interface by tapping RightShift", Duration = 7})
  649. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 470, 0, 400)}):Play()
  650. TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 470, 0, 45)}):Play()
  651. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  652. TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  653. TweenService:Create(Main.Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  654. TweenService:Create(Main.Topbar.CornerRepair, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  655. TweenService:Create(Main.Topbar.Title, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  656. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  657. TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  658. for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  659. if TopbarButton.ClassName == "ImageButton" then
  660. TweenService:Create(TopbarButton, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  661. end
  662. end
  663. for _, tabbtn in ipairs(TabList:GetChildren()) do
  664. if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  665. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  666. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  667. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  668. TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  669. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  670. end
  671. end
  672. for _, tab in ipairs(Elements:GetChildren()) do
  673. if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  674. for _, element in ipairs(tab:GetChildren()) do
  675. if element.ClassName == "Frame" then
  676. if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  677. if element.Name == "SectionTitle" then
  678. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  679. else
  680. TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  681. TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  682. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  683. end
  684. for _, child in ipairs(element:GetChildren()) do
  685. if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  686. child.Visible = false
  687. end
  688. end
  689. end
  690. end
  691. end
  692. end
  693. end
  694. wait(0.5)
  695. Main.Visible = false
  696. Debounce = false
  697. end
  698.  
  699. function Unhide()
  700. Debounce = true
  701. Main.Position = UDim2.new(0.5, 0, 0.5, 0)
  702. Main.Visible = true
  703. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 475)}):Play()
  704. TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 45)}):Play()
  705. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.4}):Play()
  706. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  707. TweenService:Create(Main.Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  708. TweenService:Create(Main.Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  709. TweenService:Create(Main.Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  710. TweenService:Create(Main.Topbar.Title, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  711. if Minimised then
  712. spawn(Maximise)
  713. end
  714. for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  715. if TopbarButton.ClassName == "ImageButton" then
  716. TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  717. end
  718. end
  719. for _, tabbtn in ipairs(TabList:GetChildren()) do
  720. if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  721. if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  722. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  723. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  724. TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.9}):Play()
  725. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  726. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  727. else
  728. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.7}):Play()
  729. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.2}):Play()
  730. TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.7}):Play()
  731. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0.2}):Play()
  732. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  733. end
  734.  
  735. end
  736. end
  737. for _, tab in ipairs(Elements:GetChildren()) do
  738. if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  739. for _, element in ipairs(tab:GetChildren()) do
  740. if element.ClassName == "Frame" then
  741. if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  742. if element.Name == "SectionTitle" then
  743. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  744. else
  745. TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  746. TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  747. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  748. end
  749. for _, child in ipairs(element:GetChildren()) do
  750. if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  751. child.Visible = true
  752. end
  753. end
  754. end
  755. end
  756. end
  757. end
  758. end
  759. wait(0.5)
  760. Minimised = false
  761. Debounce = false
  762. end
  763.  
  764. function Maximise()
  765. Debounce = true
  766. Topbar.ChangeSize.Image = "rbxassetid://"..10137941941
  767.  
  768.  
  769. TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  770. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 0.4}):Play()
  771. TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  772. TweenService:Create(Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  773. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 475)}):Play()
  774. TweenService:Create(Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 45)}):Play()
  775. TabList.Visible = true
  776. wait(0.2)
  777.  
  778. Elements.Visible = true
  779.  
  780. for _, tab in ipairs(Elements:GetChildren()) do
  781. if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  782. for _, element in ipairs(tab:GetChildren()) do
  783. if element.ClassName == "Frame" then
  784. if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  785. if element.Name == "SectionTitle" then
  786. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  787. else
  788. TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  789. TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  790. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  791. end
  792. for _, child in ipairs(element:GetChildren()) do
  793. if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  794. child.Visible = true
  795. end
  796. end
  797. end
  798. end
  799. end
  800. end
  801. end
  802.  
  803.  
  804. wait(0.1)
  805.  
  806. for _, tabbtn in ipairs(TabList:GetChildren()) do
  807. if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  808. if tostring(Elements.UIPageLayout.CurrentPage) == tabbtn.Title.Text then
  809. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  810. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  811. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  812. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  813. TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.9}):Play()
  814. else
  815. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.7}):Play()
  816. TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.7}):Play()
  817. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.2}):Play()
  818. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0.2}):Play()
  819. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  820. end
  821.  
  822. end
  823. end
  824.  
  825.  
  826. wait(0.5)
  827. Debounce = false
  828. end
  829.  
  830. function Minimise()
  831. Debounce = true
  832. Topbar.ChangeSize.Image = "rbxassetid://"..11036884234
  833.  
  834. for _, tabbtn in ipairs(TabList:GetChildren()) do
  835. if tabbtn.ClassName == "Frame" and tabbtn.Name ~= "Placeholder" then
  836. TweenService:Create(tabbtn, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  837. TweenService:Create(tabbtn.Image, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  838. TweenService:Create(tabbtn.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  839. TweenService:Create(tabbtn.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  840. TweenService:Create(tabbtn.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  841. end
  842. end
  843.  
  844. for _, tab in ipairs(Elements:GetChildren()) do
  845. if tab.Name ~= "Template" and tab.ClassName == "ScrollingFrame" and tab.Name ~= "Placeholder" then
  846. for _, element in ipairs(tab:GetChildren()) do
  847. if element.ClassName == "Frame" then
  848. if element.Name ~= "SectionSpacing" and element.Name ~= "Placeholder" then
  849. if element.Name == "SectionTitle" then
  850. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  851. else
  852. TweenService:Create(element, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  853. TweenService:Create(element.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  854. TweenService:Create(element.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  855. end
  856. for _, child in ipairs(element:GetChildren()) do
  857. if child.ClassName == "Frame" or child.ClassName == "TextLabel" or child.ClassName == "TextBox" or child.ClassName == "ImageButton" or child.ClassName == "ImageLabel" then
  858. child.Visible = false
  859. end
  860. end
  861. end
  862. end
  863. end
  864. end
  865. end
  866.  
  867. TweenService:Create(Topbar.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  868. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  869. TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  870. TweenService:Create(Topbar.Divider, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  871. TweenService:Create(Main, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 495, 0, 45)}):Play()
  872. TweenService:Create(Topbar, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 495, 0, 45)}):Play()
  873.  
  874. wait(0.3)
  875.  
  876. Elements.Visible = false
  877. TabList.Visible = false
  878.  
  879. wait(0.2)
  880. Debounce = false
  881. end
  882.  
  883. function RayfieldLibrary:CreateWindow(Settings)
  884. local Passthrough = false
  885. Topbar.Title.Text = Settings.Name
  886. Main.Size = UDim2.new(0, 450, 0, 260)
  887. Main.Visible = true
  888. Main.BackgroundTransparency = 1
  889. LoadingFrame.Title.TextTransparency = 1
  890. LoadingFrame.Subtitle.TextTransparency = 1
  891. Main.Shadow.Image.ImageTransparency = 1
  892. LoadingFrame.Version.TextTransparency = 1
  893. LoadingFrame.Title.Text = Settings.LoadingTitle or "Rayfield Interface Suite"
  894. LoadingFrame.Subtitle.Text = Settings.LoadingSubtitle or "by Sirius"
  895. if Settings.LoadingTitle ~= "Rayfield Interface Suite" then
  896. LoadingFrame.Version.Text = "Rayfield UI"
  897. end
  898. Topbar.Visible = false
  899. Elements.Visible = false
  900. LoadingFrame.Visible = true
  901.  
  902.  
  903. pcall(function()
  904. if not Settings.ConfigurationSaving.FileName then
  905. Settings.ConfigurationSaving.FileName = tostring(game.PlaceId)
  906. end
  907. if not isfolder(RayfieldFolder.."/".."Configuration Folders") then
  908.  
  909. end
  910. if Settings.ConfigurationSaving.Enabled == nil then
  911. Settings.ConfigurationSaving.Enabled = false
  912. end
  913. CFileName = Settings.ConfigurationSaving.FileName
  914. ConfigurationFolder = Settings.ConfigurationSaving.FolderName or ConfigurationFolder
  915. CEnabled = Settings.ConfigurationSaving.Enabled
  916.  
  917. if Settings.ConfigurationSaving.Enabled then
  918. if not isfolder(ConfigurationFolder) then
  919. makefolder(ConfigurationFolder)
  920. end
  921. end
  922. end)
  923.  
  924. AddDraggingFunctionality(Topbar,Main)
  925.  
  926. for _, TabButton in ipairs(TabList:GetChildren()) do
  927. if TabButton.ClassName == "Frame" and TabButton.Name ~= "Placeholder" then
  928. TabButton.BackgroundTransparency = 1
  929. TabButton.Title.TextTransparency = 1
  930. TabButton.Shadow.ImageTransparency = 1
  931. TabButton.Image.ImageTransparency = 1
  932. TabButton.UIStroke.Transparency = 1
  933. end
  934. end
  935.  
  936. if Settings.Discord then
  937. if not isfolder(RayfieldFolder.."/Discord Invites") then
  938. makefolder(RayfieldFolder.."/Discord Invites")
  939. end
  940. if not isfile(RayfieldFolder.."/Discord Invites".."/"..Settings.Discord.Invite..ConfigurationExtension) then
  941. if request then
  942. request({
  943. Url = 'http://127.0.0.1:6463/rpc?v=1',
  944. Method = 'POST',
  945. Headers = {
  946. ['Content-Type'] = 'application/json',
  947. Origin = 'https://discord.com'
  948. },
  949. Body = HttpService:JSONEncode({
  950. cmd = 'INVITE_BROWSER',
  951. nonce = HttpService:GenerateGUID(false),
  952. args = {code = Settings.Discord.Invite}
  953. })
  954. })
  955. end
  956.  
  957. if Settings.Discord.RememberJoins then -- We do logic this way so if the developer changes this setting, the user still won't be prompted, only new users
  958. writefile(RayfieldFolder.."/Discord Invites".."/"..Settings.Discord.Invite..ConfigurationExtension,"Rayfield RememberJoins is true for this invite, this invite will not ask you to join again")
  959. end
  960. else
  961.  
  962. end
  963. end
  964.  
  965. if Settings.KeySystem then
  966. if not Settings.KeySettings then
  967. Passthrough = true
  968. return
  969. end
  970.  
  971. if not isfolder(RayfieldFolder.."/Key System") then
  972. makefolder(RayfieldFolder.."/Key System")
  973. end
  974.  
  975. if Settings.KeySettings.GrabKeyFromSite then
  976. local Success, Response = pcall(function()
  977. Settings.KeySettings.Key = game:HttpGet(Settings.KeySettings.Key)
  978. end)
  979. if not Success then
  980. print("Rayfield | "..Settings.KeySettings.Key.." Error " ..tostring(Response))
  981. end
  982. end
  983.  
  984. if not Settings.KeySettings.FileName then
  985. Settings.KeySettings.FileName = "No file name specified"
  986. end
  987.  
  988. if isfile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension) then
  989. if readfile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension) == Settings.KeySettings.Key then
  990. Passthrough = true
  991. end
  992. end
  993.  
  994. if not Passthrough then
  995. local AttemptsRemaining = math.random(2,6)
  996. Rayfield.Enabled = false
  997. local KeyUI = game:GetObjects("rbxassetid://11380036235")[1]
  998.  
  999. if gethui then
  1000. KeyUI.Parent = gethui()
  1001. elseif syn.protect_gui then
  1002. syn.protect_gui(Rayfield)
  1003. KeyUI.Parent = CoreGui
  1004. else
  1005. KeyUI.Parent = CoreGui
  1006. end
  1007.  
  1008. if gethui then
  1009. for _, Interface in ipairs(gethui():GetChildren()) do
  1010. if Interface.Name == KeyUI.Name and Interface ~= KeyUI then
  1011. Interface.Enabled = false
  1012. Interface.Name = "KeyUI-Old"
  1013. end
  1014. end
  1015. else
  1016. for _, Interface in ipairs(CoreGui:GetChildren()) do
  1017. if Interface.Name == KeyUI.Name and Interface ~= KeyUI then
  1018. Interface.Enabled = false
  1019. Interface.Name = "KeyUI-Old"
  1020. end
  1021. end
  1022. end
  1023.  
  1024. local KeyMain = KeyUI.Main
  1025. KeyMain.Title.Text = Settings.KeySettings.Title or Settings.Name
  1026. KeyMain.Subtitle.Text = Settings.KeySettings.Subtitle or "Key System"
  1027. KeyMain.NoteMessage.Text = Settings.KeySettings.Note or "No instructions"
  1028.  
  1029. KeyMain.Size = UDim2.new(0, 467, 0, 175)
  1030. KeyMain.BackgroundTransparency = 1
  1031. KeyMain.Shadow.Image.ImageTransparency = 1
  1032. KeyMain.Title.TextTransparency = 1
  1033. KeyMain.Subtitle.TextTransparency = 1
  1034. KeyMain.KeyNote.TextTransparency = 1
  1035. KeyMain.Input.BackgroundTransparency = 1
  1036. KeyMain.Input.UIStroke.Transparency = 1
  1037. KeyMain.Input.InputBox.TextTransparency = 1
  1038. KeyMain.NoteTitle.TextTransparency = 1
  1039. KeyMain.NoteMessage.TextTransparency = 1
  1040. KeyMain.Hide.ImageTransparency = 1
  1041.  
  1042. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1043. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 187)}):Play()
  1044. TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 0.5}):Play()
  1045. wait(0.05)
  1046. TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1047. TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1048. wait(0.05)
  1049. TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1050. TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1051. TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1052. TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1053. wait(0.05)
  1054. TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1055. TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1056. wait(0.15)
  1057. TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {ImageTransparency = 0.3}):Play()
  1058.  
  1059.  
  1060. KeyUI.Main.Input.InputBox.FocusLost:Connect(function()
  1061. if KeyMain.Input.InputBox.Text == Settings.KeySettings.Key then
  1062. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1063. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1064. TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1065. TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1066. TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1067. TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1068. TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1069. TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1070. TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1071. TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1072. TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1073. TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1074. wait(0.51)
  1075. Passthrough = true
  1076. if Settings.KeySettings.SaveKey then
  1077. if writefile then
  1078. writefile(RayfieldFolder.."/Key System".."/"..Settings.KeySettings.FileName..ConfigurationExtension, Settings.KeySettings.Key)
  1079. end
  1080. RayfieldLibrary:Notify({Title = "Key System", Content = "The key for this script has been saved successfully"})
  1081. end
  1082. else
  1083. if AttemptsRemaining == 0 then
  1084. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1085. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1086. TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1087. TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1088. TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1089. TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1090. TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1091. TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1092. TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1093. TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1094. TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1095. TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1096. wait(0.45)
  1097. game.Players.LocalPlayer:Kick("No Attempts Remaining")
  1098. game:Shutdown()
  1099. end
  1100. KeyMain.Input.InputBox.Text = ""
  1101. AttemptsRemaining = AttemptsRemaining - 1
  1102. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1103. TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Elastic), {Position = UDim2.new(0.495,0,0.5,0)}):Play()
  1104. wait(0.1)
  1105. TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Elastic), {Position = UDim2.new(0.505,0,0.5,0)}):Play()
  1106. wait(0.1)
  1107. TweenService:Create(KeyMain, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {Position = UDim2.new(0.5,0,0.5,0)}):Play()
  1108. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 187)}):Play()
  1109. end
  1110. end)
  1111.  
  1112. KeyMain.Hide.MouseButton1Click:Connect(function()
  1113. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1114. TweenService:Create(KeyMain, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 467, 0, 175)}):Play()
  1115. TweenService:Create(KeyMain.Shadow.Image, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1116. TweenService:Create(KeyMain.Title, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1117. TweenService:Create(KeyMain.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1118. TweenService:Create(KeyMain.KeyNote, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1119. TweenService:Create(KeyMain.Input, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1120. TweenService:Create(KeyMain.Input.UIStroke, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1121. TweenService:Create(KeyMain.Input.InputBox, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1122. TweenService:Create(KeyMain.NoteTitle, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1123. TweenService:Create(KeyMain.NoteMessage, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1124. TweenService:Create(KeyMain.Hide, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1125. wait(0.51)
  1126. RayfieldLibrary:Destroy()
  1127. KeyUI:Destroy()
  1128. end)
  1129. else
  1130. Passthrough = true
  1131. end
  1132. end
  1133. if Settings.KeySystem then
  1134. repeat wait() until Passthrough
  1135. end
  1136.  
  1137. Notifications.Template.Visible = false
  1138. Notifications.Visible = true
  1139. Rayfield.Enabled = true
  1140. wait(0.5)
  1141. TweenService:Create(Main, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1142. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.55}):Play()
  1143. wait(0.1)
  1144. TweenService:Create(LoadingFrame.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1145. wait(0.05)
  1146. TweenService:Create(LoadingFrame.Subtitle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1147. wait(0.05)
  1148. TweenService:Create(LoadingFrame.Version, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1149.  
  1150. Elements.Template.LayoutOrder = 100000
  1151. Elements.Template.Visible = false
  1152.  
  1153. Elements.UIPageLayout.FillDirection = Enum.FillDirection.Horizontal
  1154. TabList.Template.Visible = false
  1155.  
  1156. -- Tab
  1157. local FirstTab = false
  1158. local Window = {}
  1159. function Window:CreateTab(Name,Image)
  1160. local SDone = false
  1161. local TabButton = TabList.Template:Clone()
  1162. TabButton.Name = Name
  1163. TabButton.Title.Text = Name
  1164. TabButton.Parent = TabList
  1165. TabButton.Title.TextWrapped = false
  1166. TabButton.Size = UDim2.new(0, TabButton.Title.TextBounds.X + 30, 0, 30)
  1167.  
  1168. if Image then
  1169. TabButton.Title.AnchorPoint = Vector2.new(0, 0.5)
  1170. TabButton.Title.Position = UDim2.new(0, 37, 0.5, 0)
  1171. TabButton.Image.Image = "rbxassetid://"..Image
  1172. TabButton.Image.Visible = true
  1173. TabButton.Title.TextXAlignment = Enum.TextXAlignment.Left
  1174. TabButton.Size = UDim2.new(0, TabButton.Title.TextBounds.X + 46, 0, 30)
  1175. end
  1176.  
  1177. TabButton.BackgroundTransparency = 1
  1178. TabButton.Title.TextTransparency = 1
  1179. TabButton.Shadow.ImageTransparency = 1
  1180. TabButton.Image.ImageTransparency = 1
  1181. TabButton.UIStroke.Transparency = 1
  1182.  
  1183. TabButton.Visible = true
  1184.  
  1185. -- Create Elements Page
  1186. local TabPage = Elements.Template:Clone()
  1187. TabPage.Name = Name
  1188. TabPage.Visible = true
  1189.  
  1190. TabPage.LayoutOrder = #Elements:GetChildren()
  1191.  
  1192. for _, TemplateElement in ipairs(TabPage:GetChildren()) do
  1193. if TemplateElement.ClassName == "Frame" and TemplateElement.Name ~= "Placeholder" then
  1194. TemplateElement:Destroy()
  1195. end
  1196. end
  1197.  
  1198. TabPage.Parent = Elements
  1199. if not FirstTab then
  1200. Elements.UIPageLayout.Animated = false
  1201. Elements.UIPageLayout:JumpTo(TabPage)
  1202. Elements.UIPageLayout.Animated = true
  1203. end
  1204.  
  1205. if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  1206. TabButton.Shadow.Visible = false
  1207. end
  1208. TabButton.UIStroke.Color = SelectedTheme.TabStroke
  1209. -- Animate
  1210. wait(0.1)
  1211. if FirstTab then
  1212. TabButton.BackgroundColor3 = SelectedTheme.TabBackground
  1213. TabButton.Image.ImageColor3 = SelectedTheme.TabTextColor
  1214. TabButton.Title.TextColor3 = SelectedTheme.TabTextColor
  1215. TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.7}):Play()
  1216. TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0.2}):Play()
  1217. TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.2}):Play()
  1218. TweenService:Create(TabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1219.  
  1220. TweenService:Create(TabButton.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.7}):Play()
  1221. else
  1222. FirstTab = Name
  1223. TabButton.BackgroundColor3 = SelectedTheme.TabBackgroundSelected
  1224. TabButton.Image.ImageColor3 = SelectedTheme.SelectedTabTextColor
  1225. TabButton.Title.TextColor3 = SelectedTheme.SelectedTabTextColor
  1226. TweenService:Create(TabButton.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.9}):Play()
  1227. TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  1228. TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1229. TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1230. end
  1231.  
  1232.  
  1233. TabButton.Interact.MouseButton1Click:Connect(function()
  1234. if Minimised then return end
  1235. TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1236. TweenService:Create(TabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1237. TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1238. TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  1239. TweenService:Create(TabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.TabBackgroundSelected}):Play()
  1240. TweenService:Create(TabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextColor3 = SelectedTheme.SelectedTabTextColor}):Play()
  1241. TweenService:Create(TabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageColor3 = SelectedTheme.SelectedTabTextColor}):Play()
  1242. TweenService:Create(TabButton.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.9}):Play()
  1243.  
  1244. for _, OtherTabButton in ipairs(TabList:GetChildren()) do
  1245. if OtherTabButton.Name ~= "Template" and OtherTabButton.ClassName == "Frame" and OtherTabButton ~= TabButton and OtherTabButton.Name ~= "Placeholder" then
  1246. TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.TabBackground}):Play()
  1247. TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextColor3 = SelectedTheme.TabTextColor}):Play()
  1248. TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageColor3 = SelectedTheme.TabTextColor}):Play()
  1249. TweenService:Create(OtherTabButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0.7}):Play()
  1250. TweenService:Create(OtherTabButton.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0.2}):Play()
  1251. TweenService:Create(OtherTabButton.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.2}):Play()
  1252. TweenService:Create(OtherTabButton.Shadow, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ImageTransparency = 0.7}):Play()
  1253. TweenService:Create(OtherTabButton.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1254. end
  1255. end
  1256. if Elements.UIPageLayout.CurrentPage ~= TabPage then
  1257. TweenService:Create(Elements, TweenInfo.new(1, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 460,0, 330)}):Play()
  1258. Elements.UIPageLayout:JumpTo(TabPage)
  1259. wait(0.2)
  1260. TweenService:Create(Elements, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 475,0, 366)}):Play()
  1261. end
  1262.  
  1263. end)
  1264.  
  1265. local Tab = {}
  1266.  
  1267. -- Self-Destruct
  1268. function Tab:SelfDestruct()
  1269. TabButton:Destroy()
  1270. TabPage:Destroy()
  1271. Tab:Destroy()
  1272. end
  1273.  
  1274. -- Button
  1275. function Tab:CreateButton(ButtonSettings)
  1276. local ButtonValue = {}
  1277.  
  1278. local Button = Elements.Template.Button:Clone()
  1279. Button.Name = ButtonSettings.Name
  1280. Button.Title.Text = ButtonSettings.Name
  1281. Button.Visible = true
  1282. Button.Parent = TabPage
  1283.  
  1284. Button.BackgroundTransparency = 1
  1285. Button.UIStroke.Transparency = 1
  1286. Button.Title.TextTransparency = 1
  1287.  
  1288. TweenService:Create(Button, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1289. TweenService:Create(Button.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1290. TweenService:Create(Button.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1291.  
  1292.  
  1293. Button.Interact.MouseButton1Click:Connect(function()
  1294. local Success, Response = pcall(ButtonSettings.Callback)
  1295. if not Success then
  1296. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1297. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1298. TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1299. Button.Title.Text = "Callback Error"
  1300. print("Rayfield | "..ButtonSettings.Name.." Callback Error " ..tostring(Response))
  1301. wait(0.5)
  1302. Button.Title.Text = ButtonSettings.Name
  1303. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1304. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.9}):Play()
  1305. TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1306. else
  1307. SaveConfiguration()
  1308. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1309. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1310. TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1311. wait(0.2)
  1312. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1313. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.9}):Play()
  1314. TweenService:Create(Button.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1315. end
  1316. end)
  1317.  
  1318. Button.MouseEnter:Connect(function()
  1319. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1320. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.7}):Play()
  1321. end)
  1322.  
  1323. Button.MouseLeave:Connect(function()
  1324. TweenService:Create(Button, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1325. TweenService:Create(Button.ElementIndicator, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {TextTransparency = 0.9}):Play()
  1326. end)
  1327.  
  1328. function ButtonValue:Set(NewButton)
  1329. Button.Title.Text = NewButton
  1330. Button.Name = NewButton
  1331. end
  1332.  
  1333. return ButtonValue
  1334. end
  1335.  
  1336. -- ColorPicker
  1337. function Tab:CreateColorPicker(ColorPickerSettings) -- by Throit
  1338. ColorPickerSettings.Type = "ColorPicker"
  1339. local ColorPicker = Elements.Template.ColorPicker:Clone()
  1340. local Background = ColorPicker.CPBackground
  1341. local Display = Background.Display
  1342. local Main = Background.MainCP
  1343. local Slider = ColorPicker.ColorSlider
  1344. ColorPicker.ClipsDescendants = true
  1345. ColorPicker.Name = ColorPickerSettings.Name
  1346. ColorPicker.Title.Text = ColorPickerSettings.Name
  1347. ColorPicker.Visible = true
  1348. ColorPicker.Parent = TabPage
  1349. ColorPicker.Size = UDim2.new(1, -10, 0.028, 35)
  1350. Background.Size = UDim2.new(0, 39, 0, 22)
  1351. Display.BackgroundTransparency = 0
  1352. Main.MainPoint.ImageTransparency = 1
  1353. ColorPicker.Interact.Size = UDim2.new(1, 0, 1, 0)
  1354. ColorPicker.Interact.Position = UDim2.new(0.5, 0, 0.5, 0)
  1355. ColorPicker.RGB.Position = UDim2.new(0, 17, 0, 70)
  1356. ColorPicker.HexInput.Position = UDim2.new(0, 17, 0, 90)
  1357. Main.ImageTransparency = 1
  1358. Background.BackgroundTransparency = 1
  1359.  
  1360.  
  1361.  
  1362. local opened = false
  1363. local mouse = game.Players.LocalPlayer:GetMouse()
  1364. Main.Image = "http://www.roblox.com/asset/?id=11415645739"
  1365. local mainDragging = false
  1366. local sliderDragging = false
  1367. ColorPicker.Interact.MouseButton1Down:Connect(function()
  1368. if not opened then
  1369. opened = true
  1370. TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0.224, 40)}):Play()
  1371. TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 173, 0, 86)}):Play()
  1372. TweenService:Create(Display, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1373. TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Position = UDim2.new(0.289, 0, 0.5, 0)}):Play()
  1374. TweenService:Create(ColorPicker.RGB, TweenInfo.new(0.8, Enum.EasingStyle.Quint), {Position = UDim2.new(0, 17, 0, 40)}):Play()
  1375. TweenService:Create(ColorPicker.HexInput, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Position = UDim2.new(0, 17, 0, 73)}):Play()
  1376. TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0.574, 0, 1, 0)}):Play()
  1377. TweenService:Create(Main.MainPoint, TweenInfo.new(0.2, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  1378. TweenService:Create(Main, TweenInfo.new(0.2, Enum.EasingStyle.Quint), {ImageTransparency = 0.1}):Play()
  1379. TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1380. else
  1381. opened = false
  1382. TweenService:Create(ColorPicker, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0.028, 35)}):Play()
  1383. TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 39, 0, 22)}):Play()
  1384. TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Size = UDim2.new(1, 0, 1, 0)}):Play()
  1385. TweenService:Create(ColorPicker.Interact, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Position = UDim2.new(0.5, 0, 0.5, 0)}):Play()
  1386. TweenService:Create(ColorPicker.RGB, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Position = UDim2.new(0, 17, 0, 70)}):Play()
  1387. TweenService:Create(ColorPicker.HexInput, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Position = UDim2.new(0, 17, 0, 90)}):Play()
  1388. TweenService:Create(Display, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1389. TweenService:Create(Main.MainPoint, TweenInfo.new(0.2, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1390. TweenService:Create(Main, TweenInfo.new(0.2, Enum.EasingStyle.Quint), {ImageTransparency = 1}):Play()
  1391. TweenService:Create(Background, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1392. end
  1393. end)
  1394.  
  1395. game:GetService("UserInputService").InputEnded:Connect(function(input, gameProcessed) if input.UserInputType == Enum.UserInputType.MouseButton1 then
  1396. mainDragging = false
  1397. sliderDragging = false
  1398. end end)
  1399. Main.MouseButton1Down:Connect(function()
  1400. if opened then
  1401. mainDragging = true
  1402. end
  1403. end)
  1404. Main.MainPoint.MouseButton1Down:Connect(function()
  1405. if opened then
  1406. mainDragging = true
  1407. end
  1408. end)
  1409. Slider.MouseButton1Down:Connect(function()
  1410. sliderDragging = true
  1411. end)
  1412. Slider.SliderPoint.MouseButton1Down:Connect(function()
  1413. sliderDragging = true
  1414. end)
  1415. local h,s,v = ColorPickerSettings.Color:ToHSV()
  1416. local color = Color3.fromHSV(h,s,v)
  1417. local hex = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1418. ColorPicker.HexInput.InputBox.Text = hex
  1419. local function setDisplay()
  1420. --Main
  1421. Main.MainPoint.Position = UDim2.new(s,-Main.MainPoint.AbsoluteSize.X/2,1-v,-Main.MainPoint.AbsoluteSize.Y/2)
  1422. Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1423. Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1424. Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1425. --Slider
  1426. local x = h * Slider.AbsoluteSize.X
  1427. Slider.SliderPoint.Position = UDim2.new(0,x-Slider.SliderPoint.AbsoluteSize.X/2,0.5,0)
  1428. Slider.SliderPoint.ImageColor3 = Color3.fromHSV(h,1,1)
  1429. local color = Color3.fromHSV(h,s,v)
  1430. local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1431. ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1432. ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1433. ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1434. hex = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1435. ColorPicker.HexInput.InputBox.Text = hex
  1436. end
  1437. setDisplay()
  1438. ColorPicker.HexInput.InputBox.FocusLost:Connect(function()
  1439. if not pcall(function()
  1440. local r, g, b = string.match(ColorPicker.HexInput.InputBox.Text, "^#?(%w%w)(%w%w)(%w%w)$")
  1441. local rgbColor = Color3.fromRGB(tonumber(r, 16),tonumber(g, 16), tonumber(b, 16))
  1442. h,s,v = rgbColor:ToHSV()
  1443. hex = ColorPicker.HexInput.InputBox.Text
  1444. setDisplay()
  1445. ColorPickerSettings.Color = rgbColor
  1446. end)
  1447. then
  1448. ColorPicker.HexInput.InputBox.Text = hex
  1449. end
  1450. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1451. local r,g,b = math.floor((h*255)+0.5),math.floor((s*255)+0.5),math.floor((v*255)+0.5)
  1452. ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1453. SaveConfiguration()
  1454. end)
  1455. --RGB
  1456. local function rgbBoxes(box,toChange)
  1457. local value = tonumber(box.Text)
  1458. local color = Color3.fromHSV(h,s,v)
  1459. local oldR,oldG,oldB = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1460. local save
  1461. if toChange == "R" then save = oldR;oldR = value elseif toChange == "G" then save = oldG;oldG = value else save = oldB;oldB = value end
  1462. if value then
  1463. value = math.clamp(value,0,255)
  1464. h,s,v = Color3.fromRGB(oldR,oldG,oldB):ToHSV()
  1465.  
  1466. setDisplay()
  1467. else
  1468. box.Text = tostring(save)
  1469. end
  1470. local r,g,b = math.floor((h*255)+0.5),math.floor((s*255)+0.5),math.floor((v*255)+0.5)
  1471. ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1472. SaveConfiguration()
  1473. end
  1474. ColorPicker.RGB.RInput.InputBox.FocusLost:connect(function()
  1475. rgbBoxes(ColorPicker.RGB.RInput.InputBox,"R")
  1476. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1477. end)
  1478. ColorPicker.RGB.GInput.InputBox.FocusLost:connect(function()
  1479. rgbBoxes(ColorPicker.RGB.GInput.InputBox,"G")
  1480. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1481. end)
  1482. ColorPicker.RGB.BInput.InputBox.FocusLost:connect(function()
  1483. rgbBoxes(ColorPicker.RGB.BInput.InputBox,"B")
  1484. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1485. end)
  1486.  
  1487. game:GetService("RunService").RenderStepped:connect(function()
  1488. if mainDragging then
  1489. local localX = math.clamp(mouse.X-Main.AbsolutePosition.X,0,Main.AbsoluteSize.X)
  1490. local localY = math.clamp(mouse.Y-Main.AbsolutePosition.Y,0,Main.AbsoluteSize.Y)
  1491. Main.MainPoint.Position = UDim2.new(0,localX-Main.MainPoint.AbsoluteSize.X/2,0,localY-Main.MainPoint.AbsoluteSize.Y/2)
  1492. s = localX / Main.AbsoluteSize.X
  1493. v = 1 - (localY / Main.AbsoluteSize.Y)
  1494. Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1495. Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1496. Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1497. local color = Color3.fromHSV(h,s,v)
  1498. local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1499. ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1500. ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1501. ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1502. ColorPicker.HexInput.InputBox.Text = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1503. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1504. ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1505. SaveConfiguration()
  1506. end
  1507. if sliderDragging then
  1508. local localX = math.clamp(mouse.X-Slider.AbsolutePosition.X,0,Slider.AbsoluteSize.X)
  1509. h = localX / Slider.AbsoluteSize.X
  1510. Display.BackgroundColor3 = Color3.fromHSV(h,s,v)
  1511. Slider.SliderPoint.Position = UDim2.new(0,localX-Slider.SliderPoint.AbsoluteSize.X/2,0.5,0)
  1512. Slider.SliderPoint.ImageColor3 = Color3.fromHSV(h,1,1)
  1513. Background.BackgroundColor3 = Color3.fromHSV(h,1,1)
  1514. Main.MainPoint.ImageColor3 = Color3.fromHSV(h,s,v)
  1515. local color = Color3.fromHSV(h,s,v)
  1516. local r,g,b = math.floor((color.R*255)+0.5),math.floor((color.G*255)+0.5),math.floor((color.B*255)+0.5)
  1517. ColorPicker.RGB.RInput.InputBox.Text = tostring(r)
  1518. ColorPicker.RGB.GInput.InputBox.Text = tostring(g)
  1519. ColorPicker.RGB.BInput.InputBox.Text = tostring(b)
  1520. ColorPicker.HexInput.InputBox.Text = string.format("#%02X%02X%02X",color.R*0xFF,color.G*0xFF,color.B*0xFF)
  1521. pcall(function()ColorPickerSettings.Callback(Color3.fromHSV(h,s,v))end)
  1522. ColorPickerSettings.Color = Color3.fromRGB(r,g,b)
  1523. SaveConfiguration()
  1524. end
  1525. end)
  1526.  
  1527. if Settings.ConfigurationSaving then
  1528. if Settings.ConfigurationSaving.Enabled and ColorPickerSettings.Flag then
  1529. RayfieldLibrary.Flags[ColorPickerSettings.Flag] = ColorPickerSettings
  1530. end
  1531. end
  1532.  
  1533. function ColorPickerSettings:Set(RGBColor)
  1534. ColorPickerSettings.Color = RGBColor
  1535. h,s,v = ColorPickerSettings.Color:ToHSV()
  1536. color = Color3.fromHSV(h,s,v)
  1537. setDisplay()
  1538. end
  1539.  
  1540. return ColorPickerSettings
  1541. end
  1542.  
  1543. -- Section
  1544. function Tab:CreateSection(SectionName)
  1545.  
  1546. local SectionValue = {}
  1547.  
  1548. if SDone then
  1549. local SectionSpace = Elements.Template.SectionSpacing:Clone()
  1550. SectionSpace.Visible = true
  1551. SectionSpace.Parent = TabPage
  1552. end
  1553.  
  1554. local Section = Elements.Template.SectionTitle:Clone()
  1555. Section.Title.Text = SectionName
  1556. Section.Visible = true
  1557. Section.Parent = TabPage
  1558.  
  1559. Section.Title.TextTransparency = 1
  1560. TweenService:Create(Section.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1561.  
  1562. function SectionValue:Set(NewSection)
  1563. Section.Title.Text = NewSection
  1564. end
  1565.  
  1566. SDone = true
  1567.  
  1568. function SectionValue:SelfDestruct()
  1569. SectionValue = {}
  1570. Section.Visible = false
  1571. Section:Destroy()
  1572. end
  1573.  
  1574. return SectionValue
  1575. end
  1576.  
  1577. -- Label
  1578. function Tab:CreateLabel(LabelText)
  1579. local LabelValue = {}
  1580.  
  1581. local Label = Elements.Template.Label:Clone()
  1582. Label.Title.Text = LabelText
  1583. Label.Visible = true
  1584. Label.Parent = TabPage
  1585.  
  1586. Label.BackgroundTransparency = 1
  1587. Label.UIStroke.Transparency = 1
  1588. Label.Title.TextTransparency = 1
  1589.  
  1590. Label.BackgroundColor3 = SelectedTheme.SecondaryElementBackground
  1591. Label.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  1592.  
  1593. TweenService:Create(Label, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1594. TweenService:Create(Label.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1595. TweenService:Create(Label.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1596.  
  1597. function LabelValue:Set(NewLabel)
  1598. Label.Title.Text = NewLabel
  1599. end
  1600.  
  1601. return LabelValue
  1602. end
  1603.  
  1604. -- Paragraph
  1605. function Tab:CreateParagraph(ParagraphSettings)
  1606. local ParagraphValue = {}
  1607.  
  1608. local Paragraph = Elements.Template.Paragraph:Clone()
  1609. Paragraph.Title.Text = ParagraphSettings.Title
  1610. Paragraph.Content.Text = ParagraphSettings.Content
  1611. Paragraph.Visible = true
  1612. Paragraph.Parent = TabPage
  1613.  
  1614. Paragraph.Content.Size = UDim2.new(0, 438, 0, Paragraph.Content.TextBounds.Y)
  1615. Paragraph.Content.Position = UDim2.new(1, -10, 0.575,0 )
  1616. Paragraph.Size = UDim2.new(1, -10, 0, Paragraph.Content.TextBounds.Y + 40)
  1617.  
  1618. Paragraph.BackgroundTransparency = 1
  1619. Paragraph.UIStroke.Transparency = 1
  1620. Paragraph.Title.TextTransparency = 1
  1621. Paragraph.Content.TextTransparency = 1
  1622.  
  1623. Paragraph.BackgroundColor3 = SelectedTheme.SecondaryElementBackground
  1624. Paragraph.UIStroke.Color = SelectedTheme.SecondaryElementStroke
  1625.  
  1626. TweenService:Create(Paragraph, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1627. TweenService:Create(Paragraph.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1628. TweenService:Create(Paragraph.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1629. TweenService:Create(Paragraph.Content, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1630.  
  1631. function ParagraphValue:Set(NewParagraphSettings)
  1632. Paragraph.Title.Text = NewParagraphSettings.Title
  1633. Paragraph.Content.Text = NewParagraphSettings.Content
  1634. end
  1635.  
  1636. return ParagraphValue
  1637. end
  1638.  
  1639. -- Input
  1640. function Tab:CreateInput(InputSettings)
  1641. local Input = Elements.Template.Input:Clone()
  1642. Input.Name = InputSettings.Name
  1643. Input.Title.Text = InputSettings.Name
  1644. Input.Visible = true
  1645. Input.Parent = TabPage
  1646.  
  1647. Input.BackgroundTransparency = 1
  1648. Input.UIStroke.Transparency = 1
  1649. Input.Title.TextTransparency = 1
  1650.  
  1651. Input.InputFrame.BackgroundColor3 = SelectedTheme.InputBackground
  1652. Input.InputFrame.UIStroke.Color = SelectedTheme.InputStroke
  1653.  
  1654. TweenService:Create(Input, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1655. TweenService:Create(Input.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1656. TweenService:Create(Input.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1657.  
  1658. Input.InputFrame.InputBox.PlaceholderText = InputSettings.PlaceholderText
  1659. Input.InputFrame.Size = UDim2.new(0, Input.InputFrame.InputBox.TextBounds.X + 24, 0, 30)
  1660.  
  1661. Input.InputFrame.InputBox.FocusLost:Connect(function()
  1662.  
  1663.  
  1664. local Success, Response = pcall(function()
  1665. InputSettings.Callback(Input.InputFrame.InputBox.Text)
  1666. end)
  1667. if not Success then
  1668. TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1669. TweenService:Create(Input.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1670. Input.Title.Text = "Callback Error"
  1671. print("Rayfield | "..InputSettings.Name.." Callback Error " ..tostring(Response))
  1672. wait(0.5)
  1673. Input.Title.Text = InputSettings.Name
  1674. TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1675. TweenService:Create(Input.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1676. end
  1677.  
  1678. if InputSettings.RemoveTextAfterFocusLost then
  1679. Input.InputFrame.InputBox.Text = ""
  1680. end
  1681. SaveConfiguration()
  1682. end)
  1683.  
  1684. Input.MouseEnter:Connect(function()
  1685. TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1686. end)
  1687.  
  1688. Input.MouseLeave:Connect(function()
  1689. TweenService:Create(Input, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1690. end)
  1691.  
  1692. Input.InputFrame.InputBox:GetPropertyChangedSignal("Text"):Connect(function()
  1693. TweenService:Create(Input.InputFrame, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Size = UDim2.new(0, Input.InputFrame.InputBox.TextBounds.X + 24, 0, 30)}):Play()
  1694. end)
  1695. end
  1696.  
  1697. -- Dropdown
  1698. function Tab:CreateDropdown(DropdownSettings)
  1699. local Dropdown = Elements.Template.Dropdown:Clone()
  1700. if string.find(DropdownSettings.Name,"closed") then
  1701. Dropdown.Name = "Dropdown"
  1702. else
  1703. Dropdown.Name = DropdownSettings.Name
  1704. end
  1705. Dropdown.Title.Text = DropdownSettings.Name
  1706. Dropdown.Visible = true
  1707. Dropdown.Parent = TabPage
  1708.  
  1709. Dropdown.List.Visible = false
  1710.  
  1711. Dropdown.Selected.Text = DropdownSettings.CurrentOption
  1712.  
  1713. Dropdown.BackgroundTransparency = 1
  1714. Dropdown.UIStroke.Transparency = 1
  1715. Dropdown.Title.TextTransparency = 1
  1716.  
  1717. Dropdown.Size = UDim2.new(1, -10, 0, 45)
  1718.  
  1719. TweenService:Create(Dropdown, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1720. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1721. TweenService:Create(Dropdown.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1722.  
  1723. for _, ununusedoption in ipairs(Dropdown.List:GetChildren()) do
  1724. if ununusedoption.ClassName == "Frame" and ununusedoption.Name ~= "Placeholder" then
  1725. ununusedoption:Destroy()
  1726. end
  1727. end
  1728.  
  1729. Dropdown.Toggle.Rotation = 180
  1730.  
  1731. Dropdown.Interact.MouseButton1Click:Connect(function()
  1732. TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1733. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1734. wait(0.1)
  1735. TweenService:Create(Dropdown, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1736. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.4, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1737. if Debounce then return end
  1738. if Dropdown.List.Visible then
  1739. Debounce = true
  1740. TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  1741. for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  1742. if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  1743. TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1744. TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1745. TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1746. end
  1747. end
  1748. TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ScrollBarImageTransparency = 1}):Play()
  1749. TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Rotation = 180}):Play()
  1750. wait(0.35)
  1751. Dropdown.List.Visible = false
  1752. Debounce = false
  1753. else
  1754. TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0, 180)}):Play()
  1755. Dropdown.List.Visible = true
  1756. TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ScrollBarImageTransparency = 0.7}):Play()
  1757. TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Rotation = 0}):Play()
  1758. for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  1759. if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  1760. TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1761. TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1762. TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1763. end
  1764. end
  1765. end
  1766. end)
  1767.  
  1768. Dropdown.MouseEnter:Connect(function()
  1769. if not Dropdown.List.Visible then
  1770. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1771. end
  1772. end)
  1773.  
  1774. Dropdown.MouseLeave:Connect(function()
  1775. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1776. end)
  1777.  
  1778. for _, Option in ipairs(DropdownSettings.Options) do
  1779. local DropdownOption = Elements.Template.Dropdown.List.Template:Clone()
  1780. DropdownOption.Name = Option
  1781. DropdownOption.Title.Text = Option
  1782. DropdownOption.Parent = Dropdown.List
  1783. DropdownOption.Visible = true
  1784.  
  1785. if DropdownSettings.CurrentOption == Option then
  1786. DropdownOption.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  1787. end
  1788.  
  1789. DropdownOption.BackgroundTransparency = 1
  1790. DropdownOption.UIStroke.Transparency = 1
  1791. DropdownOption.Title.TextTransparency = 1
  1792.  
  1793. DropdownOption.Interact.ZIndex = 50
  1794. DropdownOption.Interact.MouseButton1Click:Connect(function()
  1795. if Dropdown.Selected.Text ~= Option then
  1796. Dropdown.Selected.Text = Option
  1797.  
  1798. local Success, Response = pcall(function()
  1799. DropdownSettings.Callback(Option)
  1800. end)
  1801. if not Success then
  1802. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1803. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1804. Dropdown.Title.Text = "Callback Error"
  1805. print("Rayfield | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  1806. wait(0.5)
  1807. Dropdown.Title.Text = DropdownSettings.Name
  1808. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1809. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1810. end
  1811. DropdownSettings.CurrentOption = Option
  1812. for _, droption in ipairs(Dropdown.List:GetChildren()) do
  1813. if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" and droption.Name ~= DropdownSettings.CurrentOption then
  1814. TweenService:Create(droption, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(30, 30, 30)}):Play()
  1815. end
  1816. end
  1817. TweenService:Create(DropdownOption.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1818. TweenService:Create(DropdownOption, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  1819. Debounce = true
  1820. wait(0.2)
  1821. TweenService:Create(DropdownOption.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1822. wait(0.1)
  1823. TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  1824. for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  1825. if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  1826. TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1827. TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1828. TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1829. end
  1830. end
  1831. TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ScrollBarImageTransparency = 1}):Play()
  1832. TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Rotation = 180}):Play()
  1833. wait(0.35)
  1834. Dropdown.List.Visible = false
  1835. Debounce = false
  1836. SaveConfiguration()
  1837. end
  1838. end)
  1839. end
  1840.  
  1841.  
  1842. function DropdownSettings:Set(NewOption)
  1843. Dropdown.Selected.Text = NewOption
  1844. DropdownSettings.CurrentOption = NewOption
  1845. local Success, Response = pcall(function()
  1846. DropdownSettings.Callback(NewOption)
  1847. end)
  1848. if not Success then
  1849. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1850. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1851. Dropdown.Title.Text = "Callback Error"
  1852. print("Rayfield | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  1853. wait(0.5)
  1854. Dropdown.Title.Text = DropdownSettings.Name
  1855. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1856. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1857. end
  1858.  
  1859. for _, droption in ipairs(Dropdown.List:GetChildren()) do
  1860. if droption.Name ~= NewOption then
  1861. if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" then
  1862. droption.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  1863. end
  1864. else
  1865. droption.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  1866. end
  1867.  
  1868. end
  1869. end
  1870.  
  1871. if Settings.ConfigurationSaving then
  1872. if Settings.ConfigurationSaving.Enabled and DropdownSettings.Flag then
  1873. RayfieldLibrary.Flags[DropdownSettings.Flag] = DropdownSettings
  1874. end
  1875. end
  1876.  
  1877.  
  1878. function DropdownSettings:Clear()
  1879. for _, ununusedoption in ipairs(Dropdown.List:GetChildren()) do
  1880. if ununusedoption.ClassName == "Frame" then
  1881. ununusedoption:Destroy()
  1882. end
  1883. end
  1884. end
  1885.  
  1886. function DropdownSettings:Add(Option)
  1887. local DropdownOption = Elements.Template.Dropdown.List.Template:Clone()
  1888. DropdownOption.Name = Option
  1889. DropdownOption.Title.Text = Option
  1890. DropdownOption.Parent = Dropdown.List
  1891. DropdownOption.Visible = true
  1892.  
  1893. if DropdownSettings.CurrentOption == Option then
  1894. DropdownOption.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  1895. end
  1896.  
  1897. DropdownOption.BackgroundTransparency = 1
  1898. DropdownOption.UIStroke.Transparency = 1
  1899. DropdownOption.Title.TextTransparency = 1
  1900.  
  1901. DropdownOption.Interact.ZIndex = 50
  1902. DropdownOption.Interact.MouseButton1Click:Connect(function()
  1903. if Dropdown.Selected.Text ~= Option then
  1904. Dropdown.Selected.Text = Option
  1905.  
  1906. local Success, Response = pcall(function()
  1907. DropdownSettings.Callback(Option)
  1908. end)
  1909.  
  1910. if not Success then
  1911. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  1912. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1913. Dropdown.Title.Text = "Callback Error"
  1914. print("Rayfield | "..DropdownSettings.Name.." Callback Error " ..tostring(Response))
  1915. wait(0.5)
  1916. Dropdown.Title.Text = DropdownSettings.Name
  1917. TweenService:Create(Dropdown, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  1918. TweenService:Create(Dropdown.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1919. end
  1920.  
  1921. for _, droption in ipairs(Dropdown.List:GetChildren()) do
  1922. if droption.ClassName == "Frame" and droption.Name ~= "Placeholder" and droption.Name ~= DropdownSettings.CurrentOption then
  1923. TweenService:Create(droption, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(30, 30, 30)}):Play()
  1924. end
  1925. end
  1926.  
  1927. TweenService:Create(DropdownOption.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1928. TweenService:Create(DropdownOption, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(40, 40, 40)}):Play()
  1929. Debounce = true
  1930.  
  1931. wait(0.2)
  1932.  
  1933. TweenService:Create(DropdownOption.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1934. wait(0.1)
  1935.  
  1936. TweenService:Create(Dropdown, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {Size = UDim2.new(1, -10, 0, 45)}):Play()
  1937.  
  1938. for _, DropdownOpt in ipairs(Dropdown.List:GetChildren()) do
  1939. if DropdownOpt.ClassName == "Frame" and DropdownOpt.Name ~= "Placeholder" then
  1940. TweenService:Create(DropdownOpt, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {BackgroundTransparency = 1}):Play()
  1941. TweenService:Create(DropdownOpt.UIStroke, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  1942. TweenService:Create(DropdownOpt.Title, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  1943. end
  1944. end
  1945.  
  1946. TweenService:Create(Dropdown.List, TweenInfo.new(0.3, Enum.EasingStyle.Quint), {ScrollBarImageTransparency = 1}):Play()
  1947. TweenService:Create(Dropdown.Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Rotation = 180}):Play()
  1948.  
  1949. wait(0.35)
  1950.  
  1951. Dropdown.List.Visible = false
  1952. Debounce = false
  1953. SaveConfiguration()
  1954. end
  1955. end)
  1956. end
  1957.  
  1958. return DropdownSettings
  1959. end
  1960.  
  1961. -- Keybind
  1962. function Tab:CreateKeybind(KeybindSettings)
  1963. local CheckingForKey = false
  1964. local Keybind = Elements.Template.Keybind:Clone()
  1965. Keybind.Name = KeybindSettings.Name
  1966. Keybind.Title.Text = KeybindSettings.Name
  1967. Keybind.Visible = true
  1968. Keybind.Parent = TabPage
  1969.  
  1970. Keybind.BackgroundTransparency = 1
  1971. Keybind.UIStroke.Transparency = 1
  1972. Keybind.Title.TextTransparency = 1
  1973.  
  1974. Keybind.KeybindFrame.BackgroundColor3 = SelectedTheme.InputBackground
  1975. Keybind.KeybindFrame.UIStroke.Color = SelectedTheme.InputStroke
  1976.  
  1977. TweenService:Create(Keybind, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  1978. TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  1979. TweenService:Create(Keybind.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  1980.  
  1981. Keybind.KeybindFrame.KeybindBox.Text = KeybindSettings.CurrentKeybind
  1982. Keybind.KeybindFrame.Size = UDim2.new(0, Keybind.KeybindFrame.KeybindBox.TextBounds.X + 24, 0, 30)
  1983.  
  1984. Keybind.KeybindFrame.KeybindBox.Focused:Connect(function()
  1985. CheckingForKey = true
  1986. Keybind.KeybindFrame.KeybindBox.Text = ""
  1987. end)
  1988. Keybind.KeybindFrame.KeybindBox.FocusLost:Connect(function()
  1989. CheckingForKey = false
  1990. if Keybind.KeybindFrame.KeybindBox.Text == nil or "" then
  1991. Keybind.KeybindFrame.KeybindBox.Text = KeybindSettings.CurrentKeybind
  1992. SaveConfiguration()
  1993. end
  1994. end)
  1995.  
  1996. Keybind.MouseEnter:Connect(function()
  1997. TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  1998. end)
  1999.  
  2000. Keybind.MouseLeave:Connect(function()
  2001. TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2002. end)
  2003.  
  2004. UserInputService.InputBegan:Connect(function(input, processed)
  2005.  
  2006. if CheckingForKey then
  2007. if input.KeyCode ~= Enum.KeyCode.Unknown and input.KeyCode ~= Enum.KeyCode.RightShift then
  2008. local SplitMessage = string.split(tostring(input.KeyCode), ".")
  2009. local NewKeyNoEnum = SplitMessage[3]
  2010. Keybind.KeybindFrame.KeybindBox.Text = tostring(NewKeyNoEnum)
  2011. KeybindSettings.CurrentKeybind = tostring(NewKeyNoEnum)
  2012. Keybind.KeybindFrame.KeybindBox:ReleaseFocus()
  2013. SaveConfiguration()
  2014. end
  2015. elseif KeybindSettings.CurrentKeybind ~= nil and (input.KeyCode == Enum.KeyCode[KeybindSettings.CurrentKeybind] and not processed) then -- Test
  2016. local Held = true
  2017. local Connection
  2018. Connection = input.Changed:Connect(function(prop)
  2019. if prop == "UserInputState" then
  2020. Connection:Disconnect()
  2021. Held = false
  2022. end
  2023. end)
  2024.  
  2025. if not KeybindSettings.HoldToInteract then
  2026. local Success, Response = pcall(KeybindSettings.Callback)
  2027. if not Success then
  2028. TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2029. TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2030. Keybind.Title.Text = "Callback Error"
  2031. print("Rayfield | "..KeybindSettings.Name.." Callback Error " ..tostring(Response))
  2032. wait(0.5)
  2033. Keybind.Title.Text = KeybindSettings.Name
  2034. TweenService:Create(Keybind, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2035. TweenService:Create(Keybind.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2036. end
  2037. else
  2038. wait(0.25)
  2039. if Held then
  2040. local Loop; Loop = RunService.Stepped:Connect(function()
  2041. if not Held then
  2042. KeybindSettings.Callback(false) -- maybe pcall this
  2043. Loop:Disconnect()
  2044. else
  2045. KeybindSettings.Callback(true) -- maybe pcall this
  2046. end
  2047. end)
  2048. end
  2049. end
  2050. end
  2051. end)
  2052.  
  2053. Keybind.KeybindFrame.KeybindBox:GetPropertyChangedSignal("Text"):Connect(function()
  2054. TweenService:Create(Keybind.KeybindFrame, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Size = UDim2.new(0, Keybind.KeybindFrame.KeybindBox.TextBounds.X + 24, 0, 30)}):Play()
  2055. end)
  2056.  
  2057. function KeybindSettings:Set(NewKeybind)
  2058. Keybind.KeybindFrame.KeybindBox.Text = tostring(NewKeybind)
  2059. KeybindSettings.CurrentKeybind = tostring(NewKeybind)
  2060. Keybind.KeybindFrame.KeybindBox:ReleaseFocus()
  2061. SaveConfiguration()
  2062. end
  2063. if Settings.ConfigurationSaving then
  2064. if Settings.ConfigurationSaving.Enabled and KeybindSettings.Flag then
  2065. RayfieldLibrary.Flags[KeybindSettings.Flag] = KeybindSettings
  2066. end
  2067. end
  2068. return KeybindSettings
  2069. end
  2070.  
  2071. -- Toggle
  2072. function Tab:CreateToggle(ToggleSettings)
  2073. local ToggleValue = {}
  2074.  
  2075. local Toggle = Elements.Template.Toggle:Clone()
  2076. Toggle.Name = ToggleSettings.Name
  2077. Toggle.Title.Text = ToggleSettings.Name
  2078. Toggle.Visible = true
  2079. Toggle.Parent = TabPage
  2080.  
  2081. Toggle.BackgroundTransparency = 1
  2082. Toggle.UIStroke.Transparency = 1
  2083. Toggle.Title.TextTransparency = 1
  2084. Toggle.Switch.BackgroundColor3 = SelectedTheme.ToggleBackground
  2085.  
  2086. if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2087. Toggle.Switch.Shadow.Visible = false
  2088. end
  2089.  
  2090. TweenService:Create(Toggle, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  2091. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2092. TweenService:Create(Toggle.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  2093.  
  2094. if not ToggleSettings.CurrentValue then
  2095. Toggle.Switch.Indicator.Position = UDim2.new(1, -40, 0.5, 0)
  2096. Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleDisabledStroke
  2097. Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleDisabled
  2098. Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleDisabledOuterStroke
  2099. else
  2100. Toggle.Switch.Indicator.Position = UDim2.new(1, -20, 0.5, 0)
  2101. Toggle.Switch.Indicator.UIStroke.Color = SelectedTheme.ToggleEnabledStroke
  2102. Toggle.Switch.Indicator.BackgroundColor3 = SelectedTheme.ToggleEnabled
  2103. Toggle.Switch.UIStroke.Color = SelectedTheme.ToggleEnabledOuterStroke
  2104. end
  2105.  
  2106. Toggle.MouseEnter:Connect(function()
  2107. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2108. end)
  2109.  
  2110. Toggle.MouseLeave:Connect(function()
  2111. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2112. end)
  2113.  
  2114. Toggle.Interact.MouseButton1Click:Connect(function()
  2115. if ToggleSettings.CurrentValue then
  2116. ToggleSettings.CurrentValue = false
  2117. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2118. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2119. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -40, 0.5, 0)}):Play()
  2120. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2121. TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledStroke}):Play()
  2122. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleDisabled}):Play()
  2123. TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledOuterStroke}):Play()
  2124. wait(0.05)
  2125. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()
  2126. wait(0.15)
  2127. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2128. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2129. else
  2130. ToggleSettings.CurrentValue = true
  2131. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2132. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2133. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -20, 0.5, 0)}):Play()
  2134. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2135. TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledStroke}):Play()
  2136. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleEnabled}):Play()
  2137. TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledOuterStroke}):Play()
  2138. wait(0.05)
  2139. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()
  2140. wait(0.15)
  2141. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2142. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2143. end
  2144.  
  2145. local Success, Response = pcall(function()
  2146. ToggleSettings.Callback(ToggleSettings.CurrentValue)
  2147. end)
  2148. if not Success then
  2149. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2150. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2151. Toggle.Title.Text = "Callback Error"
  2152. print("Rayfield | "..ToggleSettings.Name.." Callback Error " ..tostring(Response))
  2153. wait(0.5)
  2154. Toggle.Title.Text = ToggleSettings.Name
  2155. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2156. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2157. end
  2158.  
  2159. SaveConfiguration()
  2160. end)
  2161.  
  2162. function ToggleSettings:Set(NewToggleValue)
  2163. if NewToggleValue then
  2164. ToggleSettings.CurrentValue = true
  2165. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2166. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2167. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -20, 0.5, 0)}):Play()
  2168. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2169. TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleEnabledStroke}):Play()
  2170. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleEnabled}):Play()
  2171. TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = Color3.fromRGB(100,100,100)}):Play()
  2172. wait(0.05)
  2173. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()
  2174. wait(0.15)
  2175. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2176. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2177. else
  2178. ToggleSettings.CurrentValue = false
  2179. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2180. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2181. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.45, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Position = UDim2.new(1, -40, 0.5, 0)}):Play()
  2182. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,12,0,12)}):Play()
  2183. TweenService:Create(Toggle.Switch.Indicator.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = SelectedTheme.ToggleDisabledStroke}):Play()
  2184. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.8, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {BackgroundColor3 = SelectedTheme.ToggleDisabled}):Play()
  2185. TweenService:Create(Toggle.Switch.UIStroke, TweenInfo.new(0.55, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Color = Color3.fromRGB(65,65,65)}):Play()
  2186. wait(0.05)
  2187. TweenService:Create(Toggle.Switch.Indicator, TweenInfo.new(0.4, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Size = UDim2.new(0,17,0,17)}):Play()
  2188. wait(0.15)
  2189. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2190. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2191. end
  2192. local Success, Response = pcall(function()
  2193. ToggleSettings.Callback(ToggleSettings.CurrentValue)
  2194. end)
  2195. if not Success then
  2196. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2197. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2198. Toggle.Title.Text = "Callback Error"
  2199. print("Rayfield | "..ToggleSettings.Name.." Callback Error " ..tostring(Response))
  2200. wait(0.5)
  2201. Toggle.Title.Text = ToggleSettings.Name
  2202. TweenService:Create(Toggle, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2203. TweenService:Create(Toggle.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2204. end
  2205. SaveConfiguration()
  2206. end
  2207.  
  2208. if Settings.ConfigurationSaving then
  2209. if Settings.ConfigurationSaving.Enabled and ToggleSettings.Flag then
  2210. RayfieldLibrary.Flags[ToggleSettings.Flag] = ToggleSettings
  2211. end
  2212. end
  2213.  
  2214. return ToggleSettings
  2215. end
  2216.  
  2217. -- Slider
  2218. function Tab:CreateSlider(SliderSettings)
  2219. local Dragging = false
  2220. local Slider = Elements.Template.Slider:Clone()
  2221. Slider.Name = SliderSettings.Name
  2222. Slider.Title.Text = SliderSettings.Name
  2223. Slider.Visible = true
  2224. Slider.Parent = TabPage
  2225.  
  2226. Slider.BackgroundTransparency = 1
  2227. Slider.UIStroke.Transparency = 1
  2228. Slider.Title.TextTransparency = 1
  2229.  
  2230. if SelectedTheme ~= RayfieldLibrary.Theme.Default then
  2231. Slider.Main.Shadow.Visible = false
  2232. end
  2233.  
  2234. Slider.Main.BackgroundColor3 = SelectedTheme.SliderBackground
  2235. Slider.Main.UIStroke.Color = SelectedTheme.SliderStroke
  2236. Slider.Main.Progress.BackgroundColor3 = SelectedTheme.SliderProgress
  2237.  
  2238. TweenService:Create(Slider, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  2239. TweenService:Create(Slider.UIStroke, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2240. TweenService:Create(Slider.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  2241.  
  2242. Slider.Main.Progress.Size = UDim2.new(0, Slider.Main.AbsoluteSize.X * ((SliderSettings.CurrentValue + SliderSettings.Range[1]) / (SliderSettings.Range[2] - SliderSettings.Range[1])) > 5 and Slider.Main.AbsoluteSize.X * (SliderSettings.CurrentValue / (SliderSettings.Range[2] - SliderSettings.Range[1])) or 5, 1, 0)
  2243.  
  2244. if not SliderSettings.Suffix then
  2245. Slider.Main.Information.Text = tostring(SliderSettings.CurrentValue)
  2246. else
  2247. Slider.Main.Information.Text = tostring(SliderSettings.CurrentValue) .. " " .. SliderSettings.Suffix
  2248. end
  2249.  
  2250.  
  2251. Slider.MouseEnter:Connect(function()
  2252. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackgroundHover}):Play()
  2253. end)
  2254.  
  2255. Slider.MouseLeave:Connect(function()
  2256. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2257. end)
  2258.  
  2259. Slider.Main.Interact.InputBegan:Connect(function(Input)
  2260. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  2261. Dragging = true
  2262. end
  2263. end)
  2264. Slider.Main.Interact.InputEnded:Connect(function(Input)
  2265. if Input.UserInputType == Enum.UserInputType.MouseButton1 then
  2266. Dragging = false
  2267. end
  2268. end)
  2269.  
  2270. Slider.Main.Interact.MouseButton1Down:Connect(function(X)
  2271. local Current = Slider.Main.Progress.AbsolutePosition.X + Slider.Main.Progress.AbsoluteSize.X
  2272. local Start = Current
  2273. local Location = X
  2274. local Loop; Loop = RunService.Stepped:Connect(function()
  2275. if Dragging then
  2276. Location = UserInputService:GetMouseLocation().X
  2277. Current = Current + 0.025 * (Location - Start)
  2278.  
  2279. if Location < Slider.Main.AbsolutePosition.X then
  2280. Location = Slider.Main.AbsolutePosition.X
  2281. elseif Location > Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X then
  2282. Location = Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X
  2283. end
  2284.  
  2285. if Current < Slider.Main.AbsolutePosition.X + 5 then
  2286. Current = Slider.Main.AbsolutePosition.X + 5
  2287. elseif Current > Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X then
  2288. Current = Slider.Main.AbsolutePosition.X + Slider.Main.AbsoluteSize.X
  2289. end
  2290.  
  2291. if Current <= Location and (Location - Start) < 0 then
  2292. Start = Location
  2293. elseif Current >= Location and (Location - Start) > 0 then
  2294. Start = Location
  2295. end
  2296. TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.45, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Size = UDim2.new(0, Current - Slider.Main.AbsolutePosition.X, 1, 0)}):Play()
  2297. local NewValue = SliderSettings.Range[1] + (Location - Slider.Main.AbsolutePosition.X) / Slider.Main.AbsoluteSize.X * (SliderSettings.Range[2] - SliderSettings.Range[1])
  2298.  
  2299. NewValue = math.floor(NewValue / SliderSettings.Increment + 0.5) * (SliderSettings.Increment * 10000000) / 10000000
  2300. if not SliderSettings.Suffix then
  2301. Slider.Main.Information.Text = tostring(NewValue)
  2302. else
  2303. Slider.Main.Information.Text = tostring(NewValue) .. " " .. SliderSettings.Suffix
  2304. end
  2305.  
  2306. if SliderSettings.CurrentValue ~= NewValue then
  2307. local Success, Response = pcall(function()
  2308. SliderSettings.Callback(NewValue)
  2309. end)
  2310. if not Success then
  2311. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2312. TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2313. Slider.Title.Text = "Callback Error"
  2314. print("Rayfield | "..SliderSettings.Name.." Callback Error " ..tostring(Response))
  2315. wait(0.5)
  2316. Slider.Title.Text = SliderSettings.Name
  2317. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2318. TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2319. end
  2320.  
  2321. SliderSettings.CurrentValue = NewValue
  2322. SaveConfiguration()
  2323. end
  2324. else
  2325. TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Size = UDim2.new(0, Location - Slider.Main.AbsolutePosition.X > 5 and Location - Slider.Main.AbsolutePosition.X or 5, 1, 0)}):Play()
  2326. Loop:Disconnect()
  2327. end
  2328. end)
  2329. end)
  2330.  
  2331. function SliderSettings:Set(NewVal)
  2332. TweenService:Create(Slider.Main.Progress, TweenInfo.new(0.45, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), {Size = UDim2.new(0, Slider.Main.AbsoluteSize.X * ((NewVal + SliderSettings.Range[1]) / (SliderSettings.Range[2] - SliderSettings.Range[1])) > 5 and Slider.Main.AbsoluteSize.X * (NewVal / (SliderSettings.Range[2] - SliderSettings.Range[1])) or 5, 1, 0)}):Play()
  2333. Slider.Main.Information.Text = tostring(NewVal) .. " " .. SliderSettings.Suffix
  2334. local Success, Response = pcall(function()
  2335. SliderSettings.Callback(NewVal)
  2336. end)
  2337. if not Success then
  2338. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = Color3.fromRGB(85, 0, 0)}):Play()
  2339. TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 1}):Play()
  2340. Slider.Title.Text = "Callback Error"
  2341. print("Rayfield | "..SliderSettings.Name.." Callback Error " ..tostring(Response))
  2342. wait(0.5)
  2343. Slider.Title.Text = SliderSettings.Name
  2344. TweenService:Create(Slider, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {BackgroundColor3 = SelectedTheme.ElementBackground}):Play()
  2345. TweenService:Create(Slider.UIStroke, TweenInfo.new(0.6, Enum.EasingStyle.Quint), {Transparency = 0}):Play()
  2346. end
  2347. SliderSettings.CurrentValue = NewVal
  2348. SaveConfiguration()
  2349. end
  2350. if Settings.ConfigurationSaving then
  2351. if Settings.ConfigurationSaving.Enabled and SliderSettings.Flag then
  2352. RayfieldLibrary.Flags[SliderSettings.Flag] = SliderSettings
  2353. end
  2354. end
  2355. return SliderSettings
  2356. end
  2357.  
  2358. function Tab:Clear()
  2359. for _, Element in ipairs(TabPage:GetChildren()) do
  2360. if Element.ClassName == "Frame" and Element.Name ~= "Placeholder" then
  2361. Element:Destroy()
  2362. end
  2363. end
  2364. end
  2365.  
  2366. return Tab
  2367. end
  2368.  
  2369. Elements.Visible = true
  2370.  
  2371. wait(1.2)
  2372. TweenService:Create(LoadingFrame.Title, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  2373. TweenService:Create(LoadingFrame.Subtitle, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  2374. TweenService:Create(LoadingFrame.Version, TweenInfo.new(0.5, Enum.EasingStyle.Quint), {TextTransparency = 1}):Play()
  2375. wait(0.2)
  2376. TweenService:Create(Main, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {Size = UDim2.new(0, 500, 0, 475)}):Play()
  2377. TweenService:Create(Main.Shadow.Image, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.4}):Play()
  2378.  
  2379. Topbar.BackgroundTransparency = 1
  2380. Topbar.Divider.Size = UDim2.new(0, 0, 0, 1)
  2381. Topbar.CornerRepair.BackgroundTransparency = 1
  2382. Topbar.Title.TextTransparency = 1
  2383. Topbar.Theme.ImageTransparency = 1
  2384. Topbar.ChangeSize.ImageTransparency = 1
  2385. Topbar.Hide.ImageTransparency = 1
  2386.  
  2387. wait(0.8)
  2388. Topbar.Visible = true
  2389. TweenService:Create(Topbar, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  2390. TweenService:Create(Topbar.CornerRepair, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {BackgroundTransparency = 0}):Play()
  2391. wait(0.1)
  2392. TweenService:Create(Topbar.Divider, TweenInfo.new(1, Enum.EasingStyle.Quint), {Size = UDim2.new(1, 0, 0, 1)}):Play()
  2393. wait(0.1)
  2394. TweenService:Create(Topbar.Title, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {TextTransparency = 0}):Play()
  2395. wait(0.1)
  2396. TweenService:Create(Topbar.Theme, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  2397. wait(0.1)
  2398. TweenService:Create(Topbar.ChangeSize, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  2399. wait(0.1)
  2400. TweenService:Create(Topbar.Hide, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  2401. wait(0.3)
  2402.  
  2403. return Window
  2404. end
  2405.  
  2406. function RayfieldLibrary:Destroy()
  2407. Rayfield:Destroy()
  2408. end
  2409.  
  2410. Topbar.ChangeSize.MouseButton1Click:Connect(function()
  2411. if Debounce then return end
  2412. if Minimised then
  2413. Minimised = false
  2414. Maximise()
  2415. else
  2416. Minimised = true
  2417. Minimise()
  2418. end
  2419. end)
  2420.  
  2421. Topbar.Hide.MouseButton1Click:Connect(function()
  2422. if Debounce then return end
  2423. if Hidden then
  2424. Hidden = false
  2425. Minimised = false
  2426. Unhide()
  2427. else
  2428. Hidden = true
  2429. Hide()
  2430. end
  2431. end)
  2432.  
  2433. UserInputService.InputBegan:Connect(function(input, processed)
  2434. if (input.KeyCode == Enum.KeyCode.RightShift and not processed) then
  2435. if Debounce then return end
  2436. if Hidden then
  2437. Hidden = false
  2438. Unhide()
  2439. else
  2440. Hidden = true
  2441. Hide()
  2442. end
  2443. end
  2444. end)
  2445.  
  2446. for _, TopbarButton in ipairs(Topbar:GetChildren()) do
  2447. if TopbarButton.ClassName == "ImageButton" then
  2448. TopbarButton.MouseEnter:Connect(function()
  2449. TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0}):Play()
  2450. end)
  2451.  
  2452. TopbarButton.MouseLeave:Connect(function()
  2453. TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  2454. end)
  2455.  
  2456. TopbarButton.MouseButton1Click:Connect(function()
  2457. TweenService:Create(TopbarButton, TweenInfo.new(0.7, Enum.EasingStyle.Quint), {ImageTransparency = 0.8}):Play()
  2458. end)
  2459. end
  2460. end
  2461.  
  2462. function RayfieldLibrary:LoadConfiguration()
  2463. if CEnabled then
  2464. pcall(function()
  2465. if isfile(ConfigurationFolder .. "\\" .. CFileName .. ConfigurationExtension) then
  2466. LoadConfiguration(readfile(ConfigurationFolder .. "\\" .. CFileName .. ConfigurationExtension))
  2467. RayfieldLibrary:Notify({Title = "Configuration Loaded", Content = "The configuration file for this script has been loaded from a previous session"})
  2468. end
  2469. end)
  2470. end
  2471. end
  2472.  
  2473. ---############################################---
  2474. ---############### ACTUAL CODE ################---
  2475. ---############################################---
  2476.  
  2477. local scriptVersion = "1.6.8h3"
  2478.  
  2479. if not isfolder("AAMacros" .. scriptVersion) then
  2480. makefolder("AAMacros" .. scriptVersion)
  2481. end
  2482.  
  2483. local HttpService = game:GetService("HttpService")
  2484. local Workspace = game:GetService("Workspace")
  2485. local player = game:GetService("Players").LocalPlayer
  2486. local RunService = game:GetService("RunService")
  2487. local mouse = game.Players.LocalPlayer:GetMouse()
  2488. local UserInputService = game:GetService("UserInputService")
  2489.  
  2490. getgenv().saveFileName = "Anime-Adventures_UPD10"..game.Players.LocalPlayer.Name.."-"..scriptVersion..".json"
  2491. getgenv().door = "_lobbytemplategreen1"
  2492. getgenv().raiddoor = "_lobbytemplate211"
  2493. getgenv().selectedMacroFile = "nil"
  2494.  
  2495. if getgenv().lowCpuMode == nil then
  2496. getgenv().lowCpuMode = true
  2497. end
  2498.  
  2499. local startTime = os.time(os.date("!*t"))
  2500. local startGems = game.Players.LocalPlayer._stats.gem_amount.Value
  2501.  
  2502. function getBorosPortals()
  2503. local reg = getreg() --> returns Roblox's registry in a table
  2504.  
  2505. for i,v in next, reg do
  2506. if type(v) == 'function' then --> Checks if the current iteration is a function
  2507. if getfenv(v).script then --> Checks if the function's environment is in a script
  2508. --if getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.DropService" or getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.NPCServiceClient" then
  2509. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  2510. if type(v) == 'table' then
  2511. if v["session"] then
  2512. local portals = {}
  2513. for _, item in pairs(v["session"]["inventory"]['inventory_profile_data']['unique_items']) do
  2514. if item["item_id"] == "portal_boros_g" then
  2515. table.insert(portals, item)
  2516. end
  2517. end
  2518. return portals
  2519. end
  2520. end
  2521. end
  2522. --end
  2523. end
  2524. end
  2525. end
  2526. end
  2527.  
  2528. function getCSMPortals()
  2529. local reg = getreg() --> returns Roblox's registry in a table
  2530.  
  2531. for i,v in next, reg do
  2532. if type(v) == 'function' then --> Checks if the current iteration is a function
  2533. if getfenv(v).script then --> Checks if the function's environment is in a script
  2534. --if getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.DropService" or getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.NPCServiceClient" then
  2535. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  2536. if type(v) == 'table' then
  2537. if v["session"] then
  2538. local portals = {}
  2539. for _, item in pairs(v["session"]["inventory"]['inventory_profile_data']['unique_items']) do
  2540. if item["item_id"] == "portal_csm" then
  2541. table.insert(portals, item)
  2542. end
  2543. end
  2544. return portals
  2545. end
  2546. end
  2547. end
  2548. --end
  2549. end
  2550. end
  2551. end
  2552. end
  2553.  
  2554. function tprint (tbl, indent)
  2555. if not indent then indent = 0 end
  2556. for k, v in pairs(tbl) do
  2557. formatting = string.rep(" ", indent) .. k .. ": "
  2558. if type(v) == "table" then
  2559. print(formatting)
  2560. tprint(v, indent+1)
  2561. elseif type(v) == 'boolean' then
  2562. print(formatting .. tostring(v))
  2563. else
  2564. print(formatting .. v)
  2565. end
  2566. end
  2567. end
  2568.  
  2569. function getNormalItems()
  2570. local reg = getreg() --> returns Roblox's registry in a table
  2571.  
  2572. for i,v in next, reg do
  2573. if type(v) == 'function' then --> Checks if the current iteration is a function
  2574. if getfenv(v).script then --> Checks if the function's environment is in a script
  2575. --if getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.DropService" or getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.NPCServiceClient" then
  2576. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  2577. if type(v) == 'table' then
  2578. if v["session"] then
  2579. return v["session"]["inventory"]['inventory_profile_data']['normal_items']
  2580. end
  2581. end
  2582. end
  2583. --end
  2584. end
  2585. end
  2586. end
  2587. end
  2588.  
  2589. function getItemChangesNormal(preGameTable, currentTable)
  2590. local itemChanges = {}
  2591.  
  2592. for item, amount in pairs(currentTable) do
  2593. if preGameTable[item] == nil then
  2594. print(item .. ": +" .. amount)
  2595. itemChanges[item] = "+" .. amount
  2596. else
  2597. if preGameTable[item] > amount then
  2598. print(item .. ": -" .. preGameTable[item] - amount)
  2599. itemChanges[item] = "-" .. preGameTable[item] - amount
  2600. elseif preGameTable[item] < amount then
  2601. print(item .. "+" .. amount - preGameTable[item])
  2602. itemChanges[item] = "+" .. amount - preGameTable[item]
  2603. end
  2604. end
  2605.  
  2606. end
  2607. return itemChanges
  2608. end
  2609.  
  2610. function getUniqueItems()
  2611. local reg = getreg() --> returns Roblox's registry in a table
  2612.  
  2613. for i,v in next, reg do
  2614. if type(v) == 'function' then --> Checks if the current iteration is a function
  2615. if getfenv(v).script then --> Checks if the function's environment is in a script
  2616. --if getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.DropService" or getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.NPCServiceClient" then
  2617. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  2618. if type(v) == 'table' then
  2619. if v["session"] then
  2620. return v["session"]["inventory"]['inventory_profile_data']['unique_items']
  2621. end
  2622. end
  2623. end
  2624. --end
  2625. end
  2626. end
  2627. end
  2628. end
  2629.  
  2630. function getItemChangesUnique(preGameTable, postGameTable)
  2631. local itemAdditions = {}
  2632.  
  2633. for _, item in pairs(postGameTable) do
  2634. local currentItemUUID = item['uuid']
  2635. local currentItemIsNew = true
  2636. for i, itemToCompare in pairs(preGameTable) do
  2637. if itemToCompare['uuid'] == currentItemUUID then
  2638. currentItemIsNew = false
  2639. end
  2640. end
  2641. if currentItemIsNew then
  2642. print("New Unique Item: " .. item["item_id"])
  2643. table.insert(itemAdditions, item["item_id"])
  2644. end
  2645. end
  2646.  
  2647. return itemAdditions
  2648. end
  2649.  
  2650. function shallowCopy(original)
  2651. local copy = {}
  2652. for key, value in pairs(original) do
  2653. copy[key] = value
  2654. end
  2655. return copy
  2656. end
  2657.  
  2658. repeat
  2659. local testItemGet = getNormalItems()
  2660. until testItemGet ~= nil
  2661.  
  2662. getgenv().startingInventoryNormalItems = shallowCopy(getNormalItems())
  2663. getgenv().startingInventoryUniqueItems = shallowCopy(getUniqueItems())
  2664.  
  2665.  
  2666. local function writeMacroToFile(filename)
  2667. getgenv().newMacroFile = {}
  2668. getgenv().instructionIncrement = 1
  2669.  
  2670. local function writeMacroToTable()
  2671. local mt = getrawmetatable(game)
  2672. local old = mt.__namecall
  2673. getgenv().timeOfLastCommand = os.clock()
  2674. getgenv().macroStartTime = os.clock()
  2675. setreadonly(mt,false)
  2676.  
  2677. mt.__namecall = newcclosure(function(remote,...)
  2678. local arguments = {...}
  2679. method = tostring(getnamecallmethod())
  2680.  
  2681. if method == "InvokeServer" or method == "FireServer" then
  2682. if tostring(remote) == "spawn_unit" then
  2683. function getEquippedUnits()
  2684. equippedUnits = {}
  2685. local reg = getreg() --> returns Roblox's registry in a table
  2686.  
  2687. for i,v in next, reg do
  2688. if type(v) == 'function' then --> Checks if the current iteration is a function
  2689. if getfenv(v).script then --> Checks if the function's environment is in a script
  2690. --if getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.DropService" or getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.NPCServiceClient" then
  2691. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  2692. if type(v) == 'table' then
  2693. if v["session"] then
  2694. for sus, bak in pairs(v["session"]["profile_data"]['collection']['equipped_units']) do
  2695. table.insert(equippedUnits, {bak, v["session"]["profile_data"]['collection']['owned_units'][bak]['unit_id']})
  2696. end
  2697. return equippedUnits
  2698. end
  2699. end
  2700. end
  2701. --end
  2702. end
  2703. end
  2704. end
  2705. end
  2706.  
  2707. function getUnitsData()
  2708. local v1 = {};
  2709. for x, y in pairs(require(game.ReplicatedStorage.src.Data.Units)) do
  2710. v1[x] = y
  2711. end
  2712. return v1;
  2713. end
  2714.  
  2715. function getUpgradeCost(unitID, upgradeTo)
  2716. if upgradeTo ~= 0 then
  2717. return getUnitsData()[unitID]["upgrade"][upgradeTo]['cost']
  2718. else
  2719. return getUnitsData()[unitID]["cost"]
  2720. end
  2721. end
  2722.  
  2723. local unitUUID = tostring(arguments[1])
  2724. local unitPosition = arguments[2]
  2725. local unitID
  2726.  
  2727. for _, unitDetails in pairs(getEquippedUnits()) do
  2728. if unitUUID == unitDetails[1] then
  2729. unitID = unitDetails[2]
  2730. end
  2731. end
  2732.  
  2733. getgenv().newMacroFile[tostring(instructionIncrement)] = {
  2734. ['type'] = 'spawn_unit',
  2735. ['unit'] = unitID,
  2736. ['money'] = getUpgradeCost(unitID, 0),
  2737. ['cframe'] = arguments[2].X .. ", " .. arguments[2].Y .. ", " .. arguments[2].Z .. ", 1, 0, -0, -0, 1, -0, 0, 0, 1"
  2738. }
  2739. instructionIncrement += 1
  2740. end
  2741.  
  2742. if tostring(remote) == "upgrade_unit_ingame" then
  2743. function getEquippedUnits()
  2744. equippedUnits = {}
  2745. local reg = getreg() --> returns Roblox's registry in a table
  2746.  
  2747. for i,v in next, reg do
  2748. if type(v) == 'function' then --> Checks if the current iteration is a function
  2749. if getfenv(v).script then --> Checks if the function's environment is in a script
  2750. --if getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.DropService" or getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.NPCServiceClient" then
  2751. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  2752. if type(v) == 'table' then
  2753. if v["session"] then
  2754. for sus, bak in pairs(v["session"]["profile_data"]['collection']['equipped_units']) do
  2755. table.insert(equippedUnits, {bak, v["session"]["profile_data"]['collection']['owned_units'][bak]['unit_id']})
  2756. end
  2757. return equippedUnits
  2758. end
  2759. end
  2760. end
  2761. --end
  2762. end
  2763. end
  2764. end
  2765. end
  2766.  
  2767. function getUnitsData()
  2768. local v1 = {};
  2769. for x, y in pairs(require(game.ReplicatedStorage.src.Data.Units)) do
  2770. v1[x] = y
  2771. end
  2772. return v1;
  2773. end
  2774.  
  2775. function getUpgradeCost(unitID, upgradeTo)
  2776. print(unitID)
  2777. if upgradeTo ~= 0 then
  2778. return getUnitsData()[unitID]["upgrade"][upgradeTo]['cost']
  2779. else
  2780. return getUnitsData()[unitID]["cost"]
  2781. end
  2782. end
  2783.  
  2784. local hitboxPosition = arguments[1]._hitbox.CFrame
  2785.  
  2786. local unitID
  2787.  
  2788. for _, unitDetails in pairs(getEquippedUnits()) do
  2789. print(unitDetails[1])
  2790. print(arguments[1]['_stats']['uuid'].Value)
  2791. if arguments[1]['_stats']['uuid'].Value == unitDetails[1] then
  2792. unitID = unitDetails[2]
  2793. end
  2794. end
  2795.  
  2796. if game.Players.LocalPlayer._stats.resource.Value >= getUpgradeCost(unitID, arguments[1]["_stats"]["upgrade"].Value + 1) then
  2797. getgenv().newMacroFile[tostring(instructionIncrement)] = {
  2798. ['type'] = 'upgrade_unit_ingame',
  2799. ['money'] = getUpgradeCost(unitID, arguments[1]["_stats"]["upgrade"].Value + 1),
  2800. ['pos'] = hitboxPosition.X .. ", " .. hitboxPosition.Y .. ", " .. hitboxPosition.Z
  2801. }
  2802. instructionIncrement += 1
  2803. end
  2804. end
  2805.  
  2806. if tostring(remote) == "sell_unit_ingame" then
  2807. function getEquippedUnits()
  2808. equippedUnits = {}
  2809. local reg = getreg() --> returns Roblox's registry in a table
  2810.  
  2811. for i,v in next, reg do
  2812. if type(v) == 'function' then --> Checks if the current iteration is a function
  2813. if getfenv(v).script then --> Checks if the function's environment is in a script
  2814. --if getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.DropService" or getfenv(v).script:GetFullName() == "ReplicatedStorage.src.client.Services.NPCServiceClient" then
  2815. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  2816. if type(v) == 'table' then
  2817. if v["session"] then
  2818. for sus, bak in pairs(v["session"]["profile_data"]['collection']['equipped_units']) do
  2819. table.insert(equippedUnits, {bak, v["session"]["profile_data"]['collection']['owned_units'][bak]['unit_id']})
  2820. end
  2821. return equippedUnits
  2822. end
  2823. end
  2824. end
  2825. --end
  2826. end
  2827. end
  2828. end
  2829. end
  2830.  
  2831. function getUnitsData()
  2832. local v1 = {};
  2833. for x, y in pairs(require(game.ReplicatedStorage.src.Data.Units)) do
  2834. v1[x] = y
  2835. end
  2836. return v1;
  2837. end
  2838.  
  2839. function getUpgradeCost(unitId, upgradeTo)
  2840. if upgradeTo ~= 0 then
  2841. return getUnitsData()[unitId]["upgrade"][upgradeTo]['cost']
  2842. else
  2843. return getUnitsData()[unitId]["cost"]
  2844. end
  2845. end
  2846.  
  2847. local hitboxPosition = arguments[1]._hitbox.CFrame
  2848. local unitID
  2849.  
  2850. for _, unitDetails in pairs(getEquippedUnits()) do
  2851. if unitUUID == unitDetails[1] then
  2852. unitID = unitDetails[2]
  2853. end
  2854. end
  2855.  
  2856. getgenv().newMacroFile[tostring(instructionIncrement)] = {
  2857. ['type'] = 'sell_unit_ingame',
  2858. ['money'] = 0,
  2859. ['pos'] = hitboxPosition.X .. ", " .. hitboxPosition.Y .. ", " .. hitboxPosition.Z .. ", 1, 0, -0, -0, 1, -0, 0, 0, 1"
  2860. }
  2861. instructionIncrement += 1
  2862. end
  2863. end
  2864.  
  2865. local true_args = {...}
  2866. return old(remote, unpack(true_args))
  2867. end)
  2868.  
  2869. setreadonly(mt,true)
  2870. end
  2871.  
  2872. writeMacroToTable()
  2873.  
  2874. local GameFinished = game:GetService("Workspace"):WaitForChild("_DATA"):WaitForChild("GameFinished")
  2875.  
  2876. GameFinished:GetPropertyChangedSignal("Value"):Connect(function()
  2877. print("Changed", GameFinished.Value == true)
  2878. if GameFinished.Value == true then
  2879. writefile("AAMacros" .. scriptVersion .. "\\" .. tostring(workspace._MAP_CONFIG.GetLevelData:InvokeServer()["id"]).."-"..tostring(os.date('%Y%m%d-%H%M%S')).."-"..game.Players.LocalPlayer.Name..".json", game:GetService("HttpService"):JSONEncode(getgenv().newMacroFile))
  2880. end
  2881. end)
  2882. end
  2883.  
  2884. local storyLevels = {
  2885. ["1"] = {
  2886. name = "Planet Namak",
  2887. map = "namek_cartoon",
  2888. levels = {
  2889. ["1"] = {
  2890. id = "namek_level_1"
  2891. },
  2892. ["2"] = {
  2893. id = "namek_level_2"
  2894. },
  2895. ["3"] = {
  2896. id = "namek_level_3"
  2897. },
  2898. ["4"] = {
  2899. id = "namek_level_4"
  2900. },
  2901. ["5"] = {
  2902. id = "namek_level_5"
  2903. },
  2904. ["6"] = {
  2905. id = "namek_level_6"
  2906. },
  2907. ["inf"] = {
  2908. id = "namek_infinite"
  2909. }
  2910. }
  2911. },
  2912. ["2"] = {
  2913. name = "Shiganshinu District",
  2914. map = "aot",
  2915. levels = {
  2916. ["1"] = {
  2917. id = "aot_level_1"
  2918. },
  2919. ["2"] = {
  2920. id = "aot_level_2"
  2921. },
  2922. ["3"] = {
  2923. id = "aot_level_3"
  2924. },
  2925. ["4"] = {
  2926. id = "aot_level_4"
  2927. },
  2928. ["5"] = {
  2929. id = "aot_level_5"
  2930. },
  2931. ["6"] = {
  2932. id = "aot_level_6"
  2933. },
  2934. ["inf"] = {
  2935. id = "aot_infinite"
  2936. }
  2937. }
  2938. },
  2939. ["3"] = {
  2940. name = "Snowy Town",
  2941. map = "demonslayer",
  2942. levels = {
  2943. ["1"] = {
  2944. id = "demonslayer_level_1"
  2945. },
  2946. ["2"] = {
  2947. id = "demonslayer_level_2"
  2948. },
  2949. ["3"] = {
  2950. id = "demonslayer_level_3"
  2951. },
  2952. ["4"] = {
  2953. id = "demonslayer_level_4"
  2954. },
  2955. ["5"] = {
  2956. id = "demonslayer_level_5"
  2957. },
  2958. ["6"] = {
  2959. id = "demonslayer_level_6"
  2960. },
  2961. ["inf"] = {
  2962. id = "demonslayer_infinite"
  2963. }
  2964. }
  2965. },
  2966. ["4"] = {
  2967. name = "Hidden Sand Village",
  2968. map = "naruto",
  2969. levels = {
  2970. ["1"] = {
  2971. id = "naruto_level_1"
  2972. },
  2973. ["2"] = {
  2974. id = "naruto_level_2"
  2975. },
  2976. ["3"] = {
  2977. id = "naruto_level_3"
  2978. },
  2979. ["4"] = {
  2980. id = "naruto_level_4"
  2981. },
  2982. ["5"] = {
  2983. id = "naruto_level_5"
  2984. },
  2985. ["6"] = {
  2986. id = "naruto_level_6"
  2987. },
  2988. ["inf"] = {
  2989. id = "naruto_infinite"
  2990. }
  2991. }
  2992. },
  2993. ["5"] = {
  2994. name = "Marine's Ford",
  2995. map = "marineford",
  2996. levels = {
  2997. ["1"] = {
  2998. id = "marineford_level_1"
  2999. },
  3000. ["2"] = {
  3001. id = "marineford_level_2"
  3002. },
  3003. ["3"] = {
  3004. id = "marineford_level_3"
  3005. },
  3006. ["4"] = {
  3007. id = "marineford_level_4"
  3008. },
  3009. ["5"] = {
  3010. id = "marineford_level_5"
  3011. },
  3012. ["6"] = {
  3013. id = "marineford_level_6"
  3014. },
  3015. ["inf"] = {
  3016. id = "marineford_infinite"
  3017. }
  3018. }
  3019. },
  3020. ["6"] = {
  3021. name = "Ghoul City",
  3022. map = "tokyo_ghoul",
  3023. levels = {
  3024. ["1"] = {
  3025. id = "tokyoghoul_level_1"
  3026. },
  3027. ["2"] = {
  3028. id = "tokyoghoul_level_2"
  3029. },
  3030. ["3"] = {
  3031. id = "tokyoghoul_level_3"
  3032. },
  3033. ["4"] = {
  3034. id = "tokyoghoul_level_4"
  3035. },
  3036. ["5"] = {
  3037. id = "tokyoghoul_level_5"
  3038. },
  3039. ["6"] = {
  3040. id = "tokyoghoul_level_6"
  3041. },
  3042. ["inf"] = {
  3043. id = "tokyoghoul_infinite"
  3044. }
  3045. }
  3046. },
  3047. ["7"] = {
  3048. name = "Hollow World",
  3049. map = "hueco",
  3050. levels = {
  3051. ["1"] = {
  3052. id = "hueco_level_1"
  3053. },
  3054. ["2"] = {
  3055. id = "hueco_level_2"
  3056. },
  3057. ["3"] = {
  3058. id = "hueco_level_3"
  3059. },
  3060. ["4"] = {
  3061. id = "hueco_level_4"
  3062. },
  3063. ["5"] = {
  3064. id = "hueco_level_5"
  3065. },
  3066. ["6"] = {
  3067. id = "hueco_level_6"
  3068. },
  3069. ["inf"] = {
  3070. id = "hueco_infinite"
  3071. }
  3072. }
  3073. },
  3074. ["8"] = {
  3075. name = "Ant Kingdom",
  3076. map = "hxhant",
  3077. levels = {
  3078. ["1"] = {
  3079. id = "hxhant_level_1"
  3080. },
  3081. ["2"] = {
  3082. id = "hxhant_level_2"
  3083. },
  3084. ["3"] = {
  3085. id = "hxhant_level_3"
  3086. },
  3087. ["4"] = {
  3088. id = "hxhant_level_4"
  3089. },
  3090. ["5"] = {
  3091. id = "hxhant_level_5"
  3092. },
  3093. ["6"] = {
  3094. id = "hxhant_level_6"
  3095. },
  3096. ["inf"] = {
  3097. id = "hxhant_infinite"
  3098. }
  3099. }
  3100. },
  3101. ["9"] = {
  3102. name = "Magic Town",
  3103. map = "magnolia",
  3104. levels = {
  3105. ["1"] = {
  3106. id = "magnolia_level_1"
  3107. },
  3108. ["2"] = {
  3109. id = "magnolia_level_2"
  3110. },
  3111. ["3"] = {
  3112. id = "magnolia_level_3"
  3113. },
  3114. ["4"] = {
  3115. id = "magnolia_level_4"
  3116. },
  3117. ["5"] = {
  3118. id = "magnolia_level_5"
  3119. },
  3120. ["6"] = {
  3121. id = "magnolia_level_6"
  3122. },
  3123. ["inf"] = {
  3124. id = "magnolia_infinite"
  3125. }
  3126. }
  3127. },
  3128. ["10"] = {
  3129. name = "Cursed Academy",
  3130. map = "jjk",
  3131. levels = {
  3132. ["1"] = {
  3133. id = "jjk_level_1"
  3134. },
  3135. ["2"] = {
  3136. id = "jjk_level_2"
  3137. },
  3138. ["3"] = {
  3139. id = "jjk_level_3"
  3140. },
  3141. ["4"] = {
  3142. id = "jjk_level_4"
  3143. },
  3144. ["5"] = {
  3145. id = "jjk_level_5"
  3146. },
  3147. ["6"] = {
  3148. id = "jjk_level_6"
  3149. },
  3150. ["inf"] = {
  3151. id = "jjk_infinite"
  3152. }
  3153. }
  3154. },
  3155. ["11"] = {
  3156. name = "Clover Kingdom",
  3157. map = "hage",
  3158. levels = {
  3159. ["1"] = {
  3160. id = "clover_level_1"
  3161. },
  3162. ["2"] = {
  3163. id = "clover_level_2"
  3164. },
  3165. ["3"] = {
  3166. id = "clover_level_3"
  3167. },
  3168. ["4"] = {
  3169. id = "clover_level_4"
  3170. },
  3171. ["5"] = {
  3172. id = "clover_level_5"
  3173. },
  3174. ["6"] = {
  3175. id = "clover_level_6"
  3176. },
  3177. ["inf"] = {
  3178. id = "clover_infinite"
  3179. }
  3180. }
  3181. },
  3182. ["12"] = {
  3183. name = "Cape Canaveral",
  3184. map = "space_center",
  3185. levels = {
  3186. ["1"] = {
  3187. id = "jojo_level_1"
  3188. },
  3189. ["2"] = {
  3190. id = "jojo_level_2"
  3191. },
  3192. ["3"] = {
  3193. id = "jojo_level_3"
  3194. },
  3195. ["4"] = {
  3196. id = "jojo_level_4"
  3197. },
  3198. ["5"] = {
  3199. id = "jojo_level_5"
  3200. },
  3201. ["6"] = {
  3202. id = "jojo_level_6"
  3203. },
  3204. ["inf"] = {
  3205. id = "jojo_infinite"
  3206. }
  3207. }
  3208. },
  3209. ["13"] = {
  3210. name = "Alien Ship",
  3211. map = "alien_ship",
  3212. levels = {
  3213. ["1"] = {
  3214. id = "opm_level_1"
  3215. },
  3216. ["2"] = {
  3217. id = "opm_level_2"
  3218. },
  3219. ["3"] = {
  3220. id = "opm_level_3"
  3221. },
  3222. ["4"] = {
  3223. id = "opm_level_4"
  3224. },
  3225. ["5"] = {
  3226. id = "opm_level_5"
  3227. },
  3228. ["6"] = {
  3229. id = "opm_level_6"
  3230. },
  3231. ["inf"] = {
  3232. id = "opm_infinite"
  3233. }
  3234. }
  3235. }
  3236. }
  3237.  
  3238. local function GetNextLevel(currentLevel)
  3239. for i, v in pairs(storyLevels) do
  3240. for j, u in pairs(v.levels) do
  3241. if currentLevel == u["id"] then
  3242. if j ~= "6" then --assuming 6 levels per map
  3243. return v.levels[tostring(tonumber(j) + 1)]["id"]
  3244. else
  3245. if storyLevels[tostring(i + 1)] then
  3246. return storyLevels[tostring(i + 1)]["levels"][tostring(1)]["id"]
  3247. else
  3248. return currentLevel
  3249. end
  3250. end
  3251. end
  3252. end
  3253. end
  3254. end
  3255.  
  3256. local function GetCurrentLevelId()
  3257. if game.Workspace._MAP_CONFIG then
  3258. return game:GetService("Workspace")._MAP_CONFIG.GetLevelData:InvokeServer()["id"]
  3259. end
  3260. end
  3261.  
  3262. local function GetCurrentLevelName()
  3263. if game.Workspace._MAP_CONFIG then
  3264. return game:GetService("Workspace")._MAP_CONFIG.GetLevelData:InvokeServer()["name"]
  3265. end
  3266. end
  3267.  
  3268. local function Webhook()
  3269. pcall(function()
  3270. local url = tostring(getgenv().webUrl) --webhook
  3271. print("Webhook Check")
  3272. if url == "" then
  3273. print("No Webhook URL")
  3274. return
  3275. end
  3276.  
  3277. experience = tostring(game:GetService("Players").LocalPlayer.PlayerGui.ResultsUI.Holder.LevelRewards.ScrollingFrame.XPReward.Main.Amount.Text)
  3278. gems = tostring(game:GetService("Players").LocalPlayer.PlayerGui.ResultsUI.Holder.LevelRewards.ScrollingFrame.GemReward.Main.Amount.Text)
  3279. completedWaves = game:GetService("Players").LocalPlayer.PlayerGui.ResultsUI.Holder.Middle.WavesCompleted.Text
  3280. completionTime = game:GetService("Players").LocalPlayer.PlayerGui.ResultsUI.Holder.Middle.Timer.Text
  3281. waveNumber = completedWaves:split(": ")
  3282. timeNumber = completionTime:split(": ")
  3283.  
  3284. local data = {
  3285. ["content"] = "",
  3286. ["username"] = "Anime Adventures",
  3287. ["avatar_url"] = "https://tr.rbxcdn.com/e5b5844fb26df605986b94d87384f5fb/150/150/Image/Jpeg",
  3288. ["embeds"] = {
  3289. {
  3290. ["author"] = {
  3291. ["name"] = "Level Name: " .. GetCurrentLevelName() .. " | Result",
  3292. ["icon_url"] = "https://cdn.discordapp.com/emojis/997123585476927558.webp?size=96&quality=lossless"
  3293. },
  3294. ["color"] = 0x00ff00,
  3295.  
  3296. ["thumbnail"] = {
  3297. ['url'] = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. game.Players.LocalPlayer.userId .. "&width=420&height=420&format=png"
  3298. },
  3299.  
  3300. ["fields"] = {
  3301. {
  3302. ["name"] = "Total Waves:",
  3303. ["value"] = tostring(waveNumber[2]) ..
  3304. " <:wave:997136622363627530>",
  3305. ["inline"] = true
  3306. }, {
  3307. ["name"] = "Recieved Gems:",
  3308. ["value"] = gems .. " 💎",
  3309. ["inline"] = true
  3310. }, {
  3311. ["name"] = "Recieved XP:",
  3312. ["value"] = experience .. " 🧪",
  3313. ["inline"] = true
  3314. }, {
  3315. ["name"] = "Total Time:",
  3316. ["value"] = tostring(timeNumber[2]) .. " ⏳",
  3317. ["inline"] = true
  3318. }, {
  3319. ["name"] = "Current Gems:",
  3320. ["value"] = tostring(game.Players.LocalPlayer._stats.gem_amount.Value).." 💎",
  3321. ["inline"] = true
  3322. }, {
  3323. ["name"] = "Current Level:",
  3324. ["value"] = tostring(game.Players.LocalPlayer.PlayerGui.spawn_units.Lives.Main.Desc.Level.Text).. " ✨",
  3325. ["inline"] = true
  3326. }
  3327. }
  3328. }
  3329. }
  3330. }
  3331.  
  3332. local discordMessageBody = game:GetService("HttpService"):JSONEncode(data)
  3333.  
  3334. local headers = {["content-type"] = "application/json"}
  3335. request = http_request or request or HttpPost or syn.request or http.request
  3336. local discordMessageData = {Url = url, Body = discordMessageBody, Method = "POST", Headers = headers}
  3337. warn("Sending webhook notification...")
  3338. request(discordMessageData)
  3339. end)
  3340. end
  3341.  
  3342. local function BabyWebhook()
  3343. pcall(function()
  3344. local url = tostring(getgenv().webUrl) --webhook
  3345. print("Wave Webhook?")
  3346. if url == "" then
  3347. print("No Webhook Found!")
  3348. return
  3349. end
  3350.  
  3351. current_wave = tostring(game:GetService("Workspace")["_wave_num"].Value)
  3352. XP = tostring(game:GetService("Players").LocalPlayer.PlayerGui.ResultsUI.Holder.LevelRewards.ScrollingFrame.XPReward.Main.Amount.Text)
  3353. gems = tostring(game:GetService("Players").LocalPlayer.PlayerGui.ResultsUI.Holder.LevelRewards.ScrollingFrame.GemReward.Main.Amount.Text)
  3354.  
  3355. timeSinceStart = os.time(os.date("!*t")) - startTime
  3356. gemsSinceStart = game.Players.LocalPlayer._stats.gem_amount.Value - startGems
  3357.  
  3358. local data = {
  3359. ["content"] = "",
  3360. ["username"] = "Professional Gamer",
  3361. ["avatar_url"] = "https://i.pinimg.com/originals/1c/6c/55/1c6c55a47126ddf97931d9463876594c.jpg",
  3362. ["embeds"] = {
  3363. {
  3364. ["author"] = {
  3365. ["name"] = "Current Level: " .. GetCurrentLevelName() .. " | " .. "Current Wave: " .. current_wave .. " - " .. tostring(game.Players.LocalPlayer.Name),
  3366. ["icon_url"] = "https://cdn.discordapp.com/emojis/997123585476927558.webp?size=96&quality=lossless"
  3367. },
  3368. ["color"] = 0x00FFFF,
  3369.  
  3370. ["thumbnail"] = {
  3371. ['url'] = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. game.Players.LocalPlayer.userId .. "&width=420&height=420&format=png"
  3372. },
  3373. ["fields"] = {
  3374. {
  3375. ["name"] = "Current Gems:",
  3376. ["value"] = tostring(game.Players.LocalPlayer._stats.gem_amount.Value).." 💎",
  3377. ["inline"] = true
  3378. }, {
  3379. ["name"] = "Current Level:",
  3380. ["value"] = tostring(game.Players.LocalPlayer.PlayerGui.spawn_units.Lives.Main.Desc.Level.Text).. " ✨",
  3381. ["inline"] = true
  3382. },
  3383. {
  3384. ["name"] = "Estimated Gems per Hour:",
  3385. ["value"] = tostring(math.floor(gemsSinceStart / ((timeSinceStart + 82) / (60 * 60)))).." 💎",
  3386. ["inline"] = true
  3387. }
  3388. }
  3389. }
  3390. }
  3391. }
  3392.  
  3393. local discordMessageBody = game:GetService("HttpService"):JSONEncode(data)
  3394.  
  3395. local headers = {["content-type"] = "application/json"}
  3396. request = http_request or request or HttpPost or syn.request or http.request
  3397. local discordMessageData = {Url = url, Body = discordMessageBody, Method = "POST", Headers = headers}
  3398. warn("Sending baby webhook notification...")
  3399. print(request(discordMessageData).Success)
  3400. end)
  3401. end
  3402.  
  3403. local function ShopSniperWebhook(test)
  3404. test = test or false
  3405. pcall(function()
  3406. local url = tostring(getgenv().sniperUrl) --webhook
  3407. print("Shop Sniper Webhook?")
  3408. if url == "" then
  3409. print("No Webhook Found!")
  3410. return
  3411. end
  3412.  
  3413. print(game:GetService("ReplicatedStorage").src.client.Services.TravellingMerchantServiceClient)
  3414.  
  3415. shop_items = require(game:GetService("ReplicatedStorage").src.client.Services["TravellingMerchantServiceClient"]).SELLING_ITEMS
  3416. local shop_item_ids = {}
  3417.  
  3418. print("exechere9")
  3419.  
  3420. local data = {
  3421. ["content"] = "",
  3422. ["username"] = "Professional Gamer",
  3423. ["avatar_url"] = "https://i.pinimg.com/originals/1c/6c/55/1c6c55a47126ddf97931d9463876594c.jpg",
  3424. ["embeds"] = {
  3425. {
  3426. ["author"] = {
  3427. ["name"] = "Bulma's Shop",
  3428. ["icon_url"] = "https://cdn.discordapp.com/emojis/997123585476927558.webp?size=96&quality=lossless"
  3429. },
  3430. ["color"] = 0x00FFFF,
  3431.  
  3432. ["thumbnail"] = {
  3433. ['url'] = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. game.Players.LocalPlayer.userId .. "&width=420&height=420&format=png"
  3434. },
  3435. ["fields"] = {}
  3436. }
  3437. }
  3438. }
  3439.  
  3440. print("exechere4")
  3441.  
  3442. for i, item in pairs(shop_items) do
  3443. table.insert(shop_item_ids, item["id"])
  3444. if item["gem_cost"] then
  3445. table.insert(data["embeds"][1]["fields"], {
  3446. ["name"] = item["id"],
  3447. ["value"] = item["gem_cost"] .. " 💎",
  3448. ["inline"] = true
  3449. })
  3450. else
  3451. table.insert(data["embeds"][1]["fields"], {
  3452. ["name"] = item["id"],
  3453. ["value"] = item["gold_cost"] .. " 🪙",
  3454. ["inline"] = true
  3455. })
  3456. end
  3457. end
  3458.  
  3459. print(dump(data["embeds"][1]["fields"]))
  3460.  
  3461. if not game:GetService("Workspace")["travelling_merchant"]["is_open"].Value then
  3462. table.insert(data["embeds"][1]["fields"], {
  3463. ["name"] = "SHOP CLOSED",
  3464. ["value"] = "SHOP CLOSED",
  3465. ["inline"] = true
  3466. })
  3467. end
  3468. print("exec1")
  3469. local discordMessageBody = game:GetService("HttpService"):JSONEncode(data)
  3470.  
  3471. local headers = {["content-type"] = "application/json"}
  3472. request = http_request or request or HttpPost or syn.request or http.request
  3473. local discordMessageData = {Url = url, Body = discordMessageBody, Method = "POST", Headers = headers}
  3474. if getgenv().currentMerchantItems ~= shop_item_ids or test then
  3475. getgenv().currentMerchantItems = shop_item_ids
  3476. updatejson()
  3477. warn("Sending sniper webhook notification...")
  3478. request(discordMessageData)
  3479. end
  3480. end)
  3481. end
  3482.  
  3483. local function SpecialSummonSniperWebhook(test)
  3484. test = test or false
  3485. pcall(function()
  3486. local url = tostring(getgenv().sniperUrl) --webhook
  3487. print("Special Summon Sniper Webhook?")
  3488. if url == "" then
  3489. print("No Webhook Found!")
  3490. return
  3491. end
  3492.  
  3493. local special_banner = game:GetService("Players").LocalPlayer.PlayerGui.HatchGuiNew.BannerFrames.EventClover.Main
  3494. local units = {
  3495. special_banner["Featured_One"],
  3496. special_banner["Featured_Two"],
  3497. special_banner["Featured_Three"]
  3498. }
  3499.  
  3500. local unitNamesForJson = {
  3501. special_banner["Featured_One"].name.Text,
  3502. special_banner["Featured_Two"].name.Text,
  3503. special_banner["Featured_Three"].name.Text
  3504. }
  3505.  
  3506. local data = {
  3507. ["content"] = "",
  3508. ["username"] = "Professional Gamer",
  3509. ["avatar_url"] = "https://i.pinimg.com/originals/1c/6c/55/1c6c55a47126ddf97931d9463876594c.jpg",
  3510. ["embeds"] = {
  3511. {
  3512. ["author"] = {
  3513. ["name"] = "Current Special Banner",
  3514. ["icon_url"] = "https://cdn.discordapp.com/emojis/997123585476927558.webp?size=96&quality=lossless"
  3515. },
  3516. ["color"] = 0xFF00FF,
  3517.  
  3518. ["thumbnail"] = {
  3519. ['url'] = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. game.Players.LocalPlayer.userId .. "&width=420&height=420&format=png"
  3520. },
  3521. ["fields"] = {
  3522. {
  3523. ["name"] = units[1].name.Text,
  3524. ["value"] = "(" .. units[1].Rarity.Text .. ") [Featured]",
  3525. ["inline"] = false
  3526. },
  3527. {
  3528. ["name"] = units[2].name.Text,
  3529. ["value"] = "(" .. units[2].Rarity.Text .. ")",
  3530. ["inline"] = false
  3531. },
  3532. {
  3533. ["name"] = units[3].name.Text,
  3534. ["value"] = "(" .. units[3].Rarity.Text .. ")",
  3535. ["inline"] = false
  3536. }
  3537. }
  3538. }
  3539. }
  3540. }
  3541.  
  3542. local discordMessageBody = game:GetService("HttpService"):JSONEncode(data)
  3543.  
  3544. local headers = {["content-type"] = "application/json"}
  3545. request = http_request or request or HttpPost or syn.request or http.request
  3546. local discordMessageData = {Url = url, Body = discordMessageBody, Method = "POST", Headers = headers}
  3547. if getgenv().currentSpecialBannerUnits ~= unitNamesForJson or test then
  3548. getgenv().currentSpecialBannerUnits = unitNamesForJson
  3549. updatejson()
  3550. warn("Sending special sniper webhook notification...")
  3551. request(discordMessageData)
  3552. end
  3553. end)
  3554. end
  3555.  
  3556. local function StandardSummonSniperWebhook(test)
  3557. test = test or false
  3558. pcall(function()
  3559. local url = tostring(getgenv().sniperUrl) --webhook
  3560. print("Standard Summon Sniper Webhook?")
  3561. if url == "" then
  3562. print("No Webhook Found!")
  3563. return
  3564. end
  3565.  
  3566. local units = {
  3567. game:GetService("Players").LocalPlayer.PlayerGui.HatchGuiNew.BannerFrames.Standard.Main.Scroll["1"].Main,
  3568. game:GetService("Players").LocalPlayer.PlayerGui.HatchGuiNew.BannerFrames.Standard.Main.Scroll["2"].Main,
  3569. game:GetService("Players").LocalPlayer.PlayerGui.HatchGuiNew.BannerFrames.Standard.Main.Scroll["3"].Main,
  3570. game:GetService("Players").LocalPlayer.PlayerGui.HatchGuiNew.BannerFrames.Standard.Main.Scroll["4"].Main,
  3571. game:GetService("Players").LocalPlayer.PlayerGui.HatchGuiNew.BannerFrames.Standard.Main.Scroll["5"].Main,
  3572. game:GetService("Players").LocalPlayer.PlayerGui.HatchGuiNew.BannerFrames.Standard.Main.Scroll["6"].Main
  3573. }
  3574.  
  3575. local unitIdsForJson = {
  3576. units[1].petimage.WorldModel:GetChildren()[1].Name,
  3577. units[2].petimage.WorldModel:GetChildren()[1].Name,
  3578. units[3].petimage.WorldModel:GetChildren()[1].Name,
  3579. units[4].petimage.WorldModel:GetChildren()[1].Name,
  3580. units[5].petimage.WorldModel:GetChildren()[1].Name,
  3581. units[6].petimage.WorldModel:GetChildren()[1].Name
  3582. }
  3583.  
  3584. local data = {
  3585. ["content"] = "",
  3586. ["username"] = "Professional Gamer",
  3587. ["avatar_url"] = "https://i.pinimg.com/originals/1c/6c/55/1c6c55a47126ddf97931d9463876594c.jpg",
  3588. ["embeds"] = {
  3589. {
  3590. ["author"] = {
  3591. ["name"] = "Current Standard Banner",
  3592. ["icon_url"] = "https://cdn.discordapp.com/emojis/997123585476927558.webp?size=96&quality=lossless"
  3593. },
  3594. ["color"] = 0xFF00FF,
  3595. ["thumbnail"] = {
  3596. ['url'] = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. game.Players.LocalPlayer.userId .. "&width=420&height=420&format=png"
  3597. },
  3598. ["fields"] = {}
  3599. }
  3600. }
  3601. }
  3602.  
  3603.  
  3604. for i, unit in pairs(units) do
  3605. unit_stats = {
  3606. ["name"] = unit.petimage.WorldModel:GetChildren()[1].Name,
  3607. ["value"] = unit.Rarity.Text,
  3608. ["inline"] = true
  3609. }
  3610. table.insert(data["embeds"][1]["fields"], unit_stats)
  3611. end
  3612.  
  3613. local discordMessageBody = game:GetService("HttpService"):JSONEncode(data)
  3614. local headers = {["content-type"] = "application/json"}
  3615. request = http_request or request or HttpPost or syn.request or http.request
  3616. local discordMessageData = {Url = url, Body = discordMessageBody, Method = "POST", Headers = headers}
  3617. if getgenv().currentStandardBannerUnits ~= unitIdsForJson or test then
  3618. getgenv().currentStandardBannerUnits = unitIdsForJson
  3619. updatejson()
  3620. warn("Sending standard sniper webhook notification...")
  3621. request(discordMessageData)
  3622. end
  3623. end)
  3624. end
  3625.  
  3626. local function NormalItemWebhook(test)
  3627. test = test or false
  3628. pcall(function()
  3629. local url = tostring(getgenv().webUrl) --webhook
  3630. print("Normal Item Webhook?")
  3631. if url == "" then
  3632. print("No Webhook Found!")
  3633. return
  3634. end
  3635.  
  3636. local itemDifference = getItemChangesNormal(getgenv().startingInventoryNormalItems, getNormalItems())
  3637.  
  3638. local data = {
  3639. ["content"] = "",
  3640. ["username"] = "Professional Gamer",
  3641. ["avatar_url"] = "https://i.pinimg.com/originals/1c/6c/55/1c6c55a47126ddf97931d9463876594c.jpg",
  3642. ["embeds"] = {
  3643. {
  3644. ["author"] = {
  3645. ["name"] = "New Normal Items Acquired!",
  3646. ["icon_url"] = "https://cdn.discordapp.com/emojis/997123585476927558.webp?size=96&quality=lossless"
  3647. },
  3648. ["color"] = 0xFF00FF,
  3649. ["thumbnail"] = {
  3650. ['url'] = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. game.Players.LocalPlayer.userId .. "&width=420&height=420&format=png"
  3651. }
  3652. }
  3653. }
  3654. }
  3655.  
  3656. if itemDifference ~= nil and itemDifference ~= {} then
  3657.  
  3658. for name, amount in pairs(itemDifference) do
  3659. if data["embeds"][1]["fields"] == nil then
  3660. data["embeds"][1]["fields"] = {}
  3661. end
  3662. item_stats = {
  3663. ["name"] = name,
  3664. ["value"] = amount,
  3665. ["inline"] = true
  3666. }
  3667. table.insert(data["embeds"][1]["fields"], item_stats)
  3668. end
  3669. end
  3670.  
  3671. local discordMessageBody = game:GetService("HttpService"):JSONEncode(data)
  3672. local headers = {["content-type"] = "application/json"}
  3673. request = http_request or request or HttpPost or syn.request or http.request
  3674. local discordMessageData = {Url = url, Body = discordMessageBody, Method = "POST", Headers = headers}
  3675.  
  3676. warn("Sending normal item webhook notification...")
  3677. request(discordMessageData)
  3678. end)
  3679. end
  3680.  
  3681. local function UniqueItemWebhook(test)
  3682. test = test or false
  3683. pcall(function()
  3684. local url = tostring(getgenv().webUrl) --webhook
  3685. print("Unique Item Webhook?")
  3686. if url == "" then
  3687. print("No Webhook Found!")
  3688. return
  3689. end
  3690.  
  3691. local itemDifference = getItemChangesUnique(getgenv().startingInventoryUniqueItems, getUniqueItems())
  3692.  
  3693. local data = {
  3694. ["content"] = "",
  3695. ["username"] = "Professional Gamer",
  3696. ["avatar_url"] = "https://i.pinimg.com/originals/1c/6c/55/1c6c55a47126ddf97931d9463876594c.jpg",
  3697. ["embeds"] = {
  3698. {
  3699. ["author"] = {
  3700. ["name"] = "New Unique Items Acquired!",
  3701. ["icon_url"] = "https://cdn.discordapp.com/emojis/997123585476927558.webp?size=96&quality=lossless"
  3702. },
  3703. ["color"] = 0xFF00FF,
  3704. ["thumbnail"] = {
  3705. ['url'] = "https://www.roblox.com/headshot-thumbnail/image?userId=" .. game.Players.LocalPlayer.userId .. "&width=420&height=420&format=png"
  3706. }
  3707. }
  3708. }
  3709. }
  3710.  
  3711. if itemDifference ~= nil and itemDifference ~= {} then
  3712. if data["embeds"][1]["fields"] == nil then
  3713. data["embeds"][1]["fields"] = {}
  3714. end
  3715. for _, item in pairs(itemDifference) do
  3716. item_stats = {
  3717. ["name"] = tostring(item),
  3718. ["value"] = "+1",
  3719. ["inline"] = true
  3720. }
  3721. table.insert(data["embeds"][1]["fields"], item_stats)
  3722. end
  3723. end
  3724.  
  3725. local discordMessageBody = game:GetService("HttpService"):JSONEncode(data)
  3726. local headers = {["content-type"] = "application/json"}
  3727. request = http_request or request or HttpPost or syn.request or http.request
  3728. local discordMessageData = {Url = url, Body = discordMessageBody, Method = "POST", Headers = headers}
  3729.  
  3730. warn("Sending unique item webhook notification...")
  3731. request(discordMessageData)
  3732. end)
  3733. end
  3734.  
  3735. getgenv().UnitCache = {}
  3736.  
  3737. for _, Module in next, game:GetService("ReplicatedStorage"):WaitForChild("src"):WaitForChild("Data"):WaitForChild("Units"):GetDescendants() do
  3738. if Module:IsA("ModuleScript") and Module.Name ~= "UnitPresets" then
  3739. for UnitName, UnitStats in next, require(Module) do
  3740. getgenv().UnitCache[UnitName] = UnitStats
  3741. end
  3742. end
  3743. end
  3744.  
  3745. --\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\--
  3746. --\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\--
  3747. --\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\--
  3748.  
  3749. function MainModule()
  3750. local jsonData = readfile(saveFileName)
  3751. local data = HttpService:JSONDecode(jsonData)
  3752.  
  3753. getgenv().altCount = data.altcount
  3754. getgenv().lowCpuMode = data.lowcpumode
  3755.  
  3756. getgenv().AutoLeave = data.AutoLeave
  3757. getgenv().AutoReplay = data.AutoReplay
  3758. getgenv().AutoChallenge = data.AutoChallenge
  3759. getgenv().autoRaid = data.autoraid
  3760. getgenv().autoPortal = data.autoportal
  3761. getgenv().autoPortalCSM = data.autoportalcsm
  3762. getgenv().selectedreward = data.selectedreward
  3763. getgenv().AutoChallengeAll = data.AutoChallengeAll
  3764. getgenv().disableAutoFarm = false
  3765. getgenv().sellatwave = data.sellatwave
  3766. getgenv().quitAtWave = data.quitAtWave
  3767. getgenv().autoSell = data.autoSell
  3768. getgenv().autoQuit = data.autoQuit
  3769. getgenv().AutoFarm = data.autofarm
  3770. getgenv().AutoFarmIC = data.autofarmic
  3771. getgenv().AutoFarmTP = data.autofarmtp
  3772. getgenv().AutoLoadTP = data.autoloadtp
  3773. getgenv().webUrl = data.webhook
  3774. getgenv().sniperUrl = data.sniperwebhook
  3775. getgenv().autoStart = data.autoStart
  3776. getgenv().autoUpgrade = data.autoUpgrade
  3777. getgenv().difficulty = data.difficulty
  3778. getgenv().world = data.world
  3779. getgenv().macroWorld = data.macroworld
  3780. getgenv().raidWorld = data.raidworld
  3781. getgenv().level = data.level
  3782. getgenv().raidLevel = data.raidlevel
  3783. getgenv().macroLevel = data.macrolevel
  3784. getgenv().AutoContinue = data.autocontinue
  3785. getgenv().nextLevel = data.nextlevel
  3786. getgenv().currentMerchantItems = data.currentmerchantitems
  3787. getgenv().currentSpecialBannerUnits = data.currentspecialbannerunits
  3788. getgenv().currentStandardBannerUnits = data.currentstandardbannerunits
  3789.  
  3790. getgenv().lockAutoFunctions = data.lockautofunctions
  3791.  
  3792. getgenv().SpawnUnitPos = data.xspawnUnitPos
  3793. getgenv().SelectedUnits = data.xselectedUnits
  3794. getgenv().autoabilities = data.autoabilities
  3795.  
  3796. getgenv().recordingMacro = data.recordingmacro
  3797. getgenv().recordMacroOnTeleport = data.recordmacroonteleport
  3798. getgenv().replayMacroOnTeleport = data.replaymacroonteleport
  3799. getgenv().macroToReplay = data.macrotoreplay
  3800. getgenv().levelMacros = data.levelmacros
  3801.  
  3802. getgenv().altList = data.altlist
  3803. getgenv().mainAccount = data.mainaccount
  3804. getgenv().altMode = data.altmode
  3805.  
  3806. getgenv().unitPlacementSettings = data.unitplacementsettings
  3807.  
  3808. function updatejson()
  3809. local xdata = {
  3810. altcount = getgenv().altCount,
  3811. lowcpumode = getgenv().lowCpuMode,
  3812.  
  3813. autoloadtp = getgenv().AutoLoadTP,
  3814. AutoLeave = getgenv().AutoLeave,
  3815. AutoReplay = getgenv().AutoReplay,
  3816. AutoChallenge = getgenv().AutoChallenge,
  3817. autoraid = getgenv().autoRaid,
  3818. autoportal = getgenv().autoPortal,
  3819. autoportalcsm = getgenv().autoPortalCSM,
  3820. selectedreward = getgenv().selectedreward,
  3821. AutoChallengeAll = getgenv().AutoChallengeAll,
  3822. sellatwave = getgenv().sellatwave,
  3823. quitAtWave = getgenv().quitAtWave,
  3824. autoSell = getgenv().autoSell,
  3825. autoQuit = getgenv().autoQuit,
  3826. webhook = getgenv().webUrl,
  3827. sniperwebhook = getgenv().sniperUrl,
  3828. autofarm = getgenv().AutoFarm,
  3829. autofarmic = getgenv().AutoFarmIC,
  3830. autofarmtp = getgenv().AutoFarmTP,
  3831. autoStart = getgenv().autoStart,
  3832. autoUpgrade = getgenv().autoUpgrade,
  3833. difficulty = getgenv().difficulty,
  3834. world = getgenv().world,
  3835. macroworld = getgenv().macroWorld,
  3836. raidworld = getgenv().raidWorld,
  3837. level = getgenv().level,
  3838. raidlevel = getgenv().raidLevel,
  3839. macrolevel = getgenv().macroLevel,
  3840. autocontinue = getgenv().AutoContinue,
  3841. nextlevel = getgenv().nextLevel,
  3842. currentmerchantitems = getgenv().currentMerchantItems,
  3843. currentspecialbannerunits = getgenv().currentSpecialBannerUnits,
  3844. currentstandardbannerunits = getgenv().currentStandardBannerUnits,
  3845. --door = getgenv().door,
  3846.  
  3847. lockautofunctions = getgenv().lockAutoFunctions,
  3848.  
  3849. xspawnUnitPos = getgenv().SpawnUnitPos,
  3850. xselectedUnits = getgenv().SelectedUnits,
  3851. autoabilities = getgenv().autoabilities,
  3852.  
  3853. recordingmacro = getgenv().recordingMacro,
  3854. recordmacroonteleport = getgenv().recordMacroOnTeleport,
  3855. replaymacroonteleport = getgenv().replayMacroOnTeleport,
  3856. macrotoreplay = getgenv().macroToReplay,
  3857. levelmacros = getgenv().levelMacros,
  3858.  
  3859. altlist = getgenv().altList,
  3860. mainaccount = getgenv().mainAccount,
  3861. altmode = getgenv().altMode,
  3862.  
  3863. unitplacementsettings = getgenv().unitPlacementSettings
  3864. }
  3865.  
  3866. local json = HttpService:JSONEncode(xdata)
  3867. writefile(saveFileName, json)
  3868. end
  3869.  
  3870. --\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\--
  3871. --\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\--
  3872. if (getgenv().mainAccount == "nil") then
  3873. getgenv().mainAccount = game.Players.LocalPlayer.Name
  3874. end
  3875.  
  3876. if (getgenv().altCount == nil) then
  3877. getgenv().altCount = 1
  3878. end
  3879.  
  3880. if getgenv().autoPortal == nil then
  3881. getgenv().autoPortal = false
  3882. end
  3883.  
  3884. if getgenv().autoPortalCSM == nil then
  3885. getgenv().autoPortalCSM = false
  3886. end
  3887.  
  3888. if getgenv().level == nil then
  3889. getgenv().level = "namek_level_1"
  3890. end
  3891.  
  3892. local exec = tostring(identifyexecutor())
  3893. RayfieldLib = RayfieldLibrary
  3894.  
  3895. getgenv().isAlt = false
  3896.  
  3897. print(tostring(game.Players.LocalPlayer.Name))
  3898. print(getgenv().mainAccount)
  3899.  
  3900. if tostring(game.Players.LocalPlayer.Name) ~= getgenv().mainAccount then
  3901. print(tostring(game.Players.LocalPlayer.Name) .. " IS ALT")
  3902. getgenv().isAlt = true
  3903. end
  3904.  
  3905. print(getgenv().isAlt)
  3906.  
  3907. coroutine.resume(coroutine.create(function()
  3908. while task.wait(0.1) do
  3909. if isrbxactive() ~= true and getgenv().lowCpuMode then
  3910. setfpscap(30)
  3911. game:GetService("RunService"):Set3dRenderingEnabled(false)
  3912. else
  3913. setfpscap(1000)
  3914. game:GetService("RunService"):Set3dRenderingEnabled(true)
  3915. end
  3916. end
  3917. end))
  3918.  
  3919.  
  3920. mainWindow = RayfieldLibrary:CreateWindow({
  3921. Name = "Anime Adventures " .. scriptVersion .. " - " .. exec .. " (ALT: " .. tostring(getgenv().isAlt) .. ")",
  3922. LoadingTitle = "Anime Adventures " .. scriptVersion,
  3923. LoadingSubtitle = "rewritten by Defrag"
  3924. })
  3925.  
  3926. local autoFarmTab = mainWindow:CreateTab("Auto Farm")
  3927. local autoMacroTab = mainWindow:CreateTab("Auto Macro [BETA]")
  3928. local webhookTab = mainWindow:CreateTab("Webhooks")
  3929.  
  3930. local lowCpuToggle = autoFarmTab:CreateToggle({
  3931. Name = "Turn on Low CPU Mode",
  3932. CurrentValue = getgenv().lowCpuMode,
  3933. Callback = function(bool)
  3934. getgenv().lowCpuMode = bool
  3935. updatejson()
  3936. end})
  3937.  
  3938. if game.PlaceId == 8304191830 then
  3939. updatejson()
  3940. local altsInGame = false
  3941. if getgenv().altMode and not getgenv().isAlt then
  3942. repeat
  3943. task.wait(1)
  3944. local altsInGame = 0
  3945. for _, val in pairs(game.Players:GetPlayers()) do
  3946. for i, alt in pairs(getgenv().altList) do
  3947. if tostring(val.Name) == tostring(alt) then
  3948. print(val.Name)
  3949. altsInGame += 1
  3950. break
  3951. end
  3952. end
  3953. end
  3954. until altsInGame >= getgenv().altCount
  3955. end
  3956.  
  3957. if getgenv().altMode and getgenv().isAlt then
  3958. local timer = 0
  3959. local mainAccountFound = false
  3960. repeat
  3961. task.wait(1)
  3962. timer += 1
  3963. mainAccountFound = false
  3964. for _, v in pairs(game.Players:GetPlayers()) do
  3965. if tostring(v) == getgenv().mainAccount then
  3966. mainAccountFound = true
  3967. print("FOUND")
  3968. end
  3969. end
  3970. until mainAccountFound
  3971.  
  3972. if mainAccountFound ~= true then
  3973. loadfile("TeleportTo.lua")()
  3974. end
  3975. end
  3976.  
  3977. getgenv().recordingMacro = false
  3978. autoMacroTab:CreateToggle({
  3979. Name = "Record Macro on Map Join",
  3980. CurrentValue = getgenv().recordMacroOnTeleport,
  3981. Callback = function(bool)
  3982. getgenv().recordMacroOnTeleport = bool
  3983. updatejson()
  3984. end})
  3985.  
  3986. autoMacroTab:CreateToggle({
  3987. Name = "Replay Macro on Map Join (TURN OFF RECORD MACRO)",
  3988. CurrentValue = getgenv().replayMacroOnTeleport,
  3989. Callback = function(bool)
  3990. getgenv().replayMacroOnTeleport = bool
  3991. updatejson()
  3992. end})
  3993.  
  3994.  
  3995. getgenv().macroLevels = {"nil"}
  3996.  
  3997. --Level dropdown here
  3998. local macroWorldDrop = autoMacroTab:CreateDropdown({
  3999. Name = "Select Macro World",
  4000. Options = {"Planet Namak", "Shiganshinu District", "Snowy Town","Hidden Sand Village", "Marine's Ford",
  4001. "Ghoul City", "Hollow World", "Ant Kingdom", "Magic Town", "Cursed Academy","Clover Kingdom",
  4002. "Cape Canaveral", "Alien Ship", "Clover Kingdom [Elf Invasion]", "Hollow Invasion", "Cape Canaveral [Legend]", "Chainsaw Man Contract", "Storm Hideout"},
  4003. CurrentOption = getgenv().macroWorld,
  4004. Callback = function(world)
  4005. getgenv().macroWorld = world
  4006. updatejson()
  4007.  
  4008. if world == "Planet Namak" then
  4009. getgenv().macroLevelDrop:Clear()
  4010. table.clear(macroLevels)
  4011. getgenv().macroLevels = {"namek_infinite", "namek_level_1", "namek_level_2", "namek_level_3",
  4012. "namek_level_4", "namek_level_5", "namek_level_6"}
  4013. for i, v in ipairs(macroLevels) do
  4014. getgenv().macroLevelDrop:Add(v)
  4015. end
  4016. elseif world == "Shiganshinu District" then
  4017. getgenv().macroLevelDrop:Clear()
  4018. table.clear(macroLevels)
  4019. getgenv().macroLevels = {"aot_infinite", "aot_level_1", "aot_level_2", "aot_level_3", "aot_level_4",
  4020. "aot_level_5", "aot_level_6"}
  4021. for i, v in ipairs(macroLevels) do
  4022. getgenv().macroLevelDrop:Add(v)
  4023. end
  4024. elseif world == "Snowy Town" then
  4025. getgenv().macroLevelDrop:Clear()
  4026. table.clear(macroLevels)
  4027. getgenv().macroLevels = {"demonslayer_infinite", "demonslayer_level_1", "demonslayer_level_2",
  4028. "demonslayer_level_3", "demonslayer_level_4", "demonslayer_level_5",
  4029. "demonslayer_level_6"}
  4030. for i, v in ipairs(macroLevels) do
  4031. getgenv().macroLevelDrop:Add(v)
  4032. end
  4033. elseif world == "Hidden Sand Village" then
  4034. getgenv().macroLevelDrop:Clear()
  4035. table.clear(macroLevels)
  4036. getgenv().macroLevels = {"naruto_infinite", "naruto_level_1", "naruto_level_2", "naruto_level_3",
  4037. "naruto_level_4", "naruto_level_5", "naruto_level_6"}
  4038. for i, v in ipairs(macroLevels) do
  4039. getgenv().macroLevelDrop:Add(v)
  4040. end
  4041. elseif world == "Marine's Ford" then
  4042. getgenv().macroLevelDrop:Clear()
  4043. table.clear(macroLevels)
  4044. getgenv().macroLevels = {"marineford_infinite","marineford_level_1","marineford_level_2","marineford_level_3",
  4045. "marineford_level_4","marineford_level_5","marineford_level_6"}
  4046. for i, v in ipairs(macroLevels) do
  4047. getgenv().macroLevelDrop:Add(v)
  4048. end
  4049. elseif world == "Ghoul City" then
  4050. getgenv().macroLevelDrop:Clear()
  4051. table.clear(macroLevels)
  4052. getgenv().macroLevels = {"tokyoghoul_infinite","tokyoghoul_level_1","tokyoghoul_level_2","tokyoghoul_level_3",
  4053. "tokyoghoul_level_4","tokyoghoul_level_5","tokyoghoul_level_6"}
  4054. for i, v in ipairs(macroLevels) do
  4055. getgenv().macroLevelDrop:Add(v)
  4056. end
  4057. elseif world == "Hollow World" then
  4058. getgenv().macroLevelDrop:Clear()
  4059. table.clear(macroLevels)
  4060. getgenv().macroLevels = {"hueco_infinite","hueco_level_1","hueco_level_2","hueco_level_3",
  4061. "hueco_level_4","hueco_level_5","hueco_level_6"}
  4062. for i, v in ipairs(macroLevels) do
  4063. getgenv().macroLevelDrop:Add(v)
  4064. end
  4065. elseif world == "Ant Kingdom" then
  4066. getgenv().macroLevelDrop:Clear()
  4067. table.clear(macroLevels)
  4068. getgenv().macroLevels = {"hxhant_infinite","hxhant_level_1","hxhant_level_2","hxhant_level_3",
  4069. "hxhant_level_4","hxhant_level_5","hxhant_level_6"}
  4070. for i, v in ipairs(macroLevels) do
  4071. getgenv().macroLevelDrop:Add(v)
  4072. end
  4073. elseif world == "Magic Town" then
  4074. getgenv().macroLevelDrop:Clear()
  4075. table.clear(macroLevels)
  4076. getgenv().macroLevels = {"magnolia_infinite","magnolia_level_1","magnolia_level_2","magnolia_level_3",
  4077. "magnolia_level_4","magnolia_level_5","magnolia_level_6"}
  4078. for i, v in ipairs(macroLevels) do
  4079. getgenv().macroLevelDrop:Add(v)
  4080. end
  4081. elseif world == "Cursed Academy" then
  4082. getgenv().macroLevelDrop:Clear()
  4083. table.clear(macroLevels)
  4084. getgenv().macroLevels = {"jjk_infinite","jjk_level_1","jjk_level_2","jjk_level_3",
  4085. "jjk_level_4","jjk_level_5","jjk_level_6","jjk_finger"}
  4086. for i, v in ipairs(macroLevels) do
  4087. getgenv().macroLevelDrop:Add(v)
  4088. end
  4089. elseif world == "Clover Kingdom" then
  4090. getgenv().macroLevelDrop:Clear()
  4091. table.clear(macroLevels)
  4092. getgenv().macroLevels = {"clover_infinite","clover_level_1","clover_level_2","clover_level_3",
  4093. "clover_level_4","clover_level_5","clover_level_6",}
  4094. for i, v in ipairs(macroLevels) do
  4095. getgenv().macroLevelDrop:Add(v)
  4096. end
  4097. elseif world == "Cape Canaveral" then
  4098. getgenv().macroLevelDrop:Clear()
  4099. table.clear(macroLevels)
  4100. getgenv().macroLevels = {"jojo_infinite","jojo_level_1","jojo_level_2","jojo_level_3","jojo_level_4","jojo_level_5","jojo_level_6",}
  4101. for i, v in ipairs(macroLevels) do
  4102. getgenv().macroLevelDrop:Add(v)
  4103. end
  4104. elseif world == "Alien Ship" then
  4105. getgenv().macroLevelDrop:Clear()
  4106. table.clear(macroLevels)
  4107. getgenv().macroLevels = {"opm_infinite","opm_level_1","opm_level_2","opm_level_3","opm_level_4","opm_level_5","opm_level_6","opm_portal_g"}
  4108. for i, v in ipairs(macroLevels) do
  4109. getgenv().macroLevelDrop:Add(v)
  4110. end
  4111. elseif world == "Clover Kingdom [Elf Invasion]" then
  4112. getgenv().macroLevelDrop:Clear()
  4113. table.clear(macroLevels)
  4114. getgenv().macroLevels = {"clover_legend_1","clover_legend_2","clover_legend_3",}
  4115. for i, v in ipairs(macroLevels) do
  4116. getgenv().macroLevelDrop:Add(v)
  4117. end
  4118. elseif world == "Hollow Invasion" then
  4119. getgenv().macroLevelDrop:Clear()
  4120. table.clear(macroLevels)
  4121. getgenv().macroLevels = {"bleach_legend_1","bleach_legend_2","bleach_legend_3","bleach_legend_4","bleach_legend_5","bleach_legend_6"}
  4122. for i, v in ipairs(macroLevels) do
  4123. getgenv().macroLevelDrop:Add(v)
  4124. end
  4125. elseif world == "Cape Canaveral [Legend]" then
  4126. getgenv().macroLevelDrop:Clear()
  4127. table.clear(macroLevels)
  4128. getgenv().macroLevels = {"jojo_legend_1","jojo_legend_2","jojo_legend_3","jojo_portal_pucci"}
  4129. for i, v in ipairs(macroLevels) do
  4130. getgenv().macroLevelDrop:Add(v)
  4131. end
  4132. elseif world == "Planet Namak - Frozen" then
  4133. getgenv().macroLevelDrop:Clear()
  4134. table.clear(macroLevels)
  4135. getgenv().macroLevels = {"namek_winter_1", "namek_winter_2", "namek_winter_3",
  4136. "namek_winter_4", "namek_winter_5", "namek_winter_6"}
  4137. for i, v in ipairs(macroLevels) do
  4138. getgenv().macroLevelDrop:Add(v)
  4139. end
  4140. elseif world == "Shiganshinu District - Frozen" then
  4141. getgenv().macroLevelDrop:Clear()
  4142. table.clear(macroLevels)
  4143. getgenv().macroLevels = { "aot_winter_1", "aot_winter_2", "aot_winter_3", "aot_winter_4",
  4144. "aot_winter_5", "aot_winter_6"}
  4145. for i, v in ipairs(macroLevels) do
  4146. getgenv().macroLevelDrop:Add(v)
  4147. end
  4148. elseif world == "Snowy Town - Frozen" then
  4149. getgenv().macroLevelDrop:Clear()
  4150. table.clear(macroLevels)
  4151. getgenv().macroLevels = { "demonslayer_winter_1", "demonslayer_winter_2",
  4152. "demonslayer_winter_3", "demonslayer_winter_4", "demonslayer_winter_5",
  4153. "demonslayer_winter_6"}
  4154. for i, v in ipairs(macroLevels) do
  4155. getgenv().macroLevelDrop:Add(v)
  4156. end
  4157. elseif world == "Hidden Sand Village - Frozen" then
  4158. getgenv().macroLevelDrop:Clear()
  4159. table.clear(macroLevels)
  4160. getgenv().macroLevels = {"naruto_winter_1", "naruto_winter_2", "naruto_winter_3",
  4161. "naruto_winter_4", "naruto_winter_5", "naruto_winter_6"}
  4162. for i, v in ipairs(macroLevels) do
  4163. getgenv().macroLevelDrop:Add(v)
  4164. end
  4165. elseif world == "Marine's Ford - Frozen" then
  4166. getgenv().macroLevelDrop:Clear()
  4167. table.clear(macroLevels)
  4168. getgenv().macroLevels = {"marineford_winter_1","marineford_winter_2","marineford_winter_3",
  4169. "marineford_winter_4","marineford_winter_5","marineford_winter_6"}
  4170. for i, v in ipairs(macroLevels) do
  4171. getgenv().macroLevelDrop:Add(v)
  4172. end
  4173. elseif world == "Ghoul City - Frozen" then
  4174. getgenv().macroLevelDrop:Clear()
  4175. table.clear(macroLevels)
  4176. getgenv().macroLevels = {"tokyoghoul_winter_1","tokyoghoul_winter_2","tokyoghoul_winter_3",
  4177. "tokyoghoul_winter_4","tokyoghoul_winter_5","tokyoghoul_winter_6"}
  4178. for i, v in ipairs(macroLevels) do
  4179. getgenv().macroLevelDrop:Add(v)
  4180. end
  4181. elseif world == "Hollow World - Frozen" then
  4182. getgenv().macroLevelDrop:Clear()
  4183. table.clear(macroLevels)
  4184. getgenv().macroLevels = {"hueco_winter_1","hueco_winter_2","hueco_winter_3",
  4185. "hueco_winter_4","hueco_winter_5","hueco_winter_6"}
  4186. for i, v in ipairs(macroLevels) do
  4187. getgenv().macroLevelDrop:Add(v)
  4188. end
  4189. elseif world == "Ant Kingdom - Frozen" then
  4190. getgenv().macroLevelDrop:Clear()
  4191. table.clear(macroLevels)
  4192. getgenv().macroLevels = {"hxhant_winter_1","hxhant_winter_2","hxhant_winter_3",
  4193. "hxhant_winter_4","hxhant_winter_5","hxhant_winter_6"}
  4194. for i, v in ipairs(macroLevels) do
  4195. getgenv().macroLevelDrop:Add(v)
  4196. end
  4197. elseif world == "Magic Town - Frozen" then
  4198. getgenv().macroLevelDrop:Clear()
  4199. table.clear(macroLevels)
  4200. getgenv().macroLevels = {"magnolia_winter_1","magnolia_winter_2","magnolia_winter_3",
  4201. "magnolia_winter_4","magnolia_winter_5","magnolia_winter_6"}
  4202. for i, v in ipairs(macroLevels) do
  4203. getgenv().macroLevelDrop:Add(v)
  4204. end
  4205. elseif world == "Cursed Academy - Frozen" then
  4206. getgenv().macroLevelDrop:Clear()
  4207. table.clear(macroLevels)
  4208. getgenv().macroLevels = {"jjk_winter_1","jjk_winter_2","jjk_winter_3",
  4209. "jjk_winter_4","jjk_winter_5","jjk_winter_6",}
  4210. for i, v in ipairs(macroLevels) do
  4211. getgenv().macroLevelDrop:Add(v)
  4212. end
  4213. elseif world == "Clover Kingdom - Frozen" then
  4214. getgenv().macroLevelDrop:Clear()
  4215. table.clear(macroLevels)
  4216. getgenv().macroLevels = {"clover_winter_1","clover_winter_2","clover_winter_3",
  4217. "clover_winter_4","clover_winter_5","clover_winter_6",}
  4218. for i, v in ipairs(macroLevels) do
  4219. getgenv().macroLevelDrop:Add(v)
  4220. end
  4221. elseif world == "Cape Canaveral - Frozen" then
  4222. getgenv().macroLevelDrop:Clear()
  4223. table.clear(macroLevels)
  4224. getgenv().macroLevels = {"jojo_winter_1","jojo_winter_2","jojo_winter_3","jojo_winter_4","jojo_winter_5","jojo_winter_6",}
  4225. for i, v in ipairs(macroLevels) do
  4226. getgenv().macroLevelDrop:Add(v)
  4227. end
  4228. elseif world == "Chainsaw Man Contract" then
  4229. getgenv().macroLevelDrop:Clear()
  4230. table.clear(macroLevels)
  4231. getgenv().macroLevels = {"csm_portal_1","csm_portal_2","csm_portal_3","csm_portal_4","csm_portal_5","csm_portal_6","csm_portal_secret"}
  4232. for i, v in ipairs(macroLevels) do
  4233. getgenv().macroLevelDrop:Add(v)
  4234. end
  4235. elseif world == "Storm Hideout" then
  4236. getgenv().macroLevelDrop:Clear()
  4237. table.clear(macroLevels)
  4238. getgenv().macroLevels = {"uchiha_level_1","uchiha_level_2","uchiha_level_3","uchiha_level_4","uchiha_level_5"}
  4239. for i, v in ipairs(macroLevels) do
  4240. getgenv().macroLevelDrop:Add(v)
  4241. end
  4242. elseif world == "West City" then
  4243. getgenv().macroLevelDrop:Clear()
  4244. table.clear(macroLevels)
  4245. getgenv().macroLevels = {"west_city_raid"}
  4246. for i, v in ipairs(macroLevels) do
  4247. getgenv().macroLevelDrop:Add(v)
  4248. end
  4249. elseif world == "Infinity Train" then
  4250. getgenv().macroLevelDrop:Clear()
  4251. table.clear(macroLevels)
  4252. getgenv().macroLevels = {"demonslayer_raid_1"}
  4253. for i, v in ipairs(macroLevels) do
  4254. getgenv().macroLevelDrop:Add(v)
  4255. end
  4256. elseif world == "Shiganshinu District [Raid]" then
  4257. getgenv().macroLevelDrop:Clear()
  4258. table.clear(macroLevels)
  4259. getgenv().macroLevels = {"aot_raid_1"}
  4260. for i, v in ipairs(macroLevels) do
  4261. getgenv().macroLevelDrop:Add(v)
  4262. end
  4263. elseif world == "Hidden Sand Village [Raid]" then
  4264. getgenv().macroLevelDrop:Clear()
  4265. table.clear(macroLevels)
  4266. getgenv().macroLevels = {"naruto_raid_1"}
  4267. for i, v in ipairs(macroLevels) do
  4268. getgenv().macroLevelDrop:Add(v)
  4269. end
  4270. end
  4271. end})
  4272.  
  4273. getgenv().macroLevelDrop = autoMacroTab:CreateDropdown({
  4274. Name = "Select Macro Level",
  4275. Options = getgenv().macroLevels,
  4276. CurrentOption = getgenv().macroLevel,
  4277. Callback = function(level)
  4278. getgenv().macroLevel = level
  4279. updatejson()
  4280. end})
  4281.  
  4282. --macro bound to level dropdown here
  4283. autoMacroTab:CreateDropdown({
  4284. Name = "Macro to Run on Above Level",
  4285. Options = listfiles("AAMacros" .. scriptVersion),
  4286. CurrentOption = "nil",
  4287. Callback = function(selectedFile)
  4288. getgenv().selectedMacroFile = tostring(selectedFile)
  4289. updatejson()
  4290. end})
  4291.  
  4292. --confirmation button here
  4293. autoMacroTab:CreateButton({
  4294. Name = "Confirm Selection",
  4295. Callback = function()
  4296. getgenv().levelMacros[getgenv().macroLevel] = tostring(getgenv().selectedMacroFile):gsub("\\", [[/]])
  4297. updatejson()
  4298. end})
  4299.  
  4300. --------------------------------------------------
  4301. --------------- Select Units Tab -----------------
  4302. --------------------------------------------------
  4303. local unitSelectSection = autoFarmTab:CreateSection("Select Units")
  4304.  
  4305. local Units = {}
  4306.  
  4307. local function LoadUnits()
  4308. local reg = getreg() --> returns Roblox's registry in a table
  4309. repeat task.wait() until game.Players.LocalPlayer.PlayerGui:FindFirstChild("collection"):FindFirstChild("grid"):FindFirstChild("List"):FindFirstChild("Outer"):FindFirstChild("UnitFrames")
  4310. task.wait(2)
  4311. table.clear(Units)
  4312. for i,v in next, reg do
  4313. if type(v) == 'function' then --> Checks if the current iteration is a function
  4314. if getfenv(v).script then --> Checks if the function's environment is in a script
  4315. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  4316. if type(v) == 'table' then
  4317. if v["session"] then
  4318. for sus, bak in pairs(v["session"]["profile_data"]['collection']['equipped_units']) do
  4319. table.insert(Units, v["session"]["profile_data"]['collection']['owned_units'][bak]['unit_id'].." #"..bak)
  4320. end
  4321. return(1)
  4322. end
  4323. end
  4324. end
  4325. end
  4326. end
  4327. end
  4328. end
  4329.  
  4330. LoadUnits()
  4331.  
  4332. local function Check(x, y)
  4333.  
  4334. for i, v in ipairs(game:GetService("Players").LocalPlayer.PlayerGui.collection.grid.List.Outer.UnitFrames:GetChildren()) do
  4335. if v:IsA("ImageButton") then
  4336. if v.EquippedList.Equipped.Visible == true then
  4337. if v.Main.petimage:GetChildren()[2].Name == x then
  4338. getgenv().SelectedUnits["U"..tostring(y)] = tostring(v.name.Text.." #"..v._uuid.Value)
  4339. updatejson()
  4340. return true
  4341. end
  4342. end
  4343. end
  4344. end
  4345. end
  4346.  
  4347. local function Equip()
  4348. --[[game:GetService("ReplicatedStorage").endpoints.client_to_server.unequip_all:InvokeServer()
  4349.  
  4350. for i = 1, 6 do
  4351. local unitinfo = getgenv().SelectedUnits["U" .. i]
  4352. warn(unitinfo)
  4353. if unitinfo ~= nil then
  4354. local unitinfo_ = unitinfo:split(" #")
  4355. task.wait(0.5)
  4356. game:GetService("ReplicatedStorage").endpoints.client_to_server.equip_unit:InvokeServer(unitinfo_[2])
  4357. end
  4358. end]]
  4359.  
  4360. equippedUnits = {}
  4361. local reg = getreg() --> returns Roblox's registry in a table
  4362.  
  4363. for i,v in next, reg do
  4364. if type(v) == 'function' then --> Checks if the current iteration is a function
  4365. if getfenv(v).script then --> Checks if the function's environment is in a script
  4366. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  4367. if type(v) == 'table' then
  4368. if v["session"] then
  4369. for sus, bak in pairs(v["session"]["profile_data"]['collection']['equipped_units']) do
  4370. table.insert(equippedUnits, {bak, v["session"]["profile_data"]['collection']['owned_units'][bak]['unit_id']})
  4371. end
  4372. break
  4373. end
  4374. end
  4375. end
  4376. end
  4377. end
  4378. end
  4379.  
  4380. updatejson()
  4381. end
  4382.  
  4383.  
  4384.  
  4385. autoFarmTab:CreateButton({
  4386. Name = "Select Equipped Units",
  4387. Callback = function()
  4388. equippedUnits = {}
  4389. local reg = getreg() --> returns Roblox's registry in a table
  4390.  
  4391. for i,v in next, reg do
  4392. if type(v) == 'function' then --> Checks if the current iteration is a function
  4393. if getfenv(v).script then --> Checks if the function's environment is in a script
  4394. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  4395. if type(v) == 'table' then
  4396. if v["session"] then
  4397. local iter = 1
  4398. for sus, bak in pairs(v["session"]["profile_data"]['collection']['equipped_units']) do
  4399. equippedUnits[tonumber(sus)] = {bak, v["session"]["profile_data"]['collection']['owned_units'][bak]['unit_id'], sus}
  4400. iter += 1
  4401. end
  4402. break
  4403. end
  4404. end
  4405. end
  4406. end
  4407. end
  4408. end
  4409.  
  4410. for i = 1, 6 do
  4411. if equippedUnits[i] == nil then
  4412. equippedUnits[i] = {"nil", "nil"}
  4413. end
  4414. getgenv().SelectedUnits["U"..tostring(i)] = equippedUnits[i][2].." #"..equippedUnits[i][1]
  4415. end
  4416.  
  4417. updatejson()
  4418.  
  4419. RayfieldLib:Notify({
  4420. Title = "Equipped Units Are Selected!",
  4421. Content = "The dropdowns may not show the unit names now, but it will show next time you execute!",
  4422. Duration = 6.5,
  4423. Image = 4483362458,
  4424. Actions = { -- Notification Buttons
  4425. Ignore = {
  4426. Name = "Okay!",
  4427. Callback = function()
  4428. print("The user tapped Okay!")
  4429. end},
  4430. },
  4431. })
  4432. end
  4433. })
  4434.  
  4435. local drop = autoFarmTab:CreateDropdown({
  4436. Name = "Unit 1",
  4437. Options = Units,
  4438. CurrentOption = getgenv().SelectedUnits["U1"] or "nil",
  4439. Callback = function(selectedUnit)
  4440. getgenv().SelectedUnits["U1"] = selectedUnit
  4441. Equip()
  4442. Dropdown:Set(selectedUnit)
  4443. end,
  4444. })
  4445.  
  4446. local drop2 = autoFarmTab:CreateDropdown({
  4447. Name = "Unit 2",
  4448. Options = Units,
  4449. CurrentOption = getgenv().SelectedUnits["U2"] or "nil",
  4450. Callback = function(selectedUnit)
  4451. getgenv().SelectedUnits["U2"] = selectedUnit
  4452. Equip()
  4453. Dropdown:Set(selectedUnit)
  4454. end,
  4455. })
  4456.  
  4457. local drop3 = autoFarmTab:CreateDropdown({
  4458. Name = "Unit 3",
  4459. Options = Units,
  4460. CurrentOption = getgenv().SelectedUnits["U3"] or "nil",
  4461. Callback = function(selectedUnit)
  4462. getgenv().SelectedUnits["U3"] = selectedUnit
  4463. Equip()
  4464. Dropdown:Set(selectedUnit)
  4465. end,
  4466. })
  4467.  
  4468. local drop4 = autoFarmTab:CreateDropdown({
  4469. Name = "Unit 4",
  4470. Options = Units,
  4471. CurrentOption = getgenv().SelectedUnits["U4"] or "nil",
  4472. Callback = function(selectedUnit)
  4473. getgenv().SelectedUnits["U4"] = selectedUnit
  4474. Equip()
  4475. Dropdown:Set(selectedUnit)
  4476. end,
  4477. })
  4478.  
  4479. local axx = game.Players.LocalPlayer.PlayerGui["spawn_units"].Lives.Main.Desc.Level.Text:split(" ")
  4480. _G.drop5 = nil
  4481. _G.drop6 = nil
  4482.  
  4483. if tonumber(axx[2]) >= 20 then
  4484. _G.drop5 = autoFarmTab:CreateDropdown({
  4485. Name = "Unit 5",
  4486. Options = Units,
  4487. CurrentOption = getgenv().SelectedUnits["U5"] or "nil",
  4488. Callback = function(selectedUnit)
  4489. getgenv().SelectedUnits["U5"] = selectedUnit
  4490. Equip()
  4491. Dropdown:Set(selectedUnit)
  4492. end,
  4493. })
  4494. end
  4495.  
  4496. if tonumber(axx[2]) >= 50 then
  4497. _G.drop6 = autoFarmTab:CreateDropdown({
  4498. Name = "Unit 6",
  4499. Options = Units,
  4500. CurrentOption = getgenv().SelectedUnits["U6"] or "nil",
  4501. Callback = function(selectedUnit)
  4502. getgenv().SelectedUnits["U6"] = selectedUnit
  4503. Equip()
  4504. Dropdown:Set(selectedUnit)
  4505. end,
  4506. })
  4507. end
  4508.  
  4509. local selectWorldSection = autoFarmTab:CreateSection("Select World")
  4510.  
  4511. getgenv().levels = {"nil"}
  4512. getgenv().raidLevels = {"nil"}
  4513.  
  4514. getgenv().diff = autoFarmTab:CreateDropdown({
  4515. Name = "Select Difficulty",
  4516. Options = {"Normal", "Hard"},
  4517. CurrentOption = getgenv().difficulty,
  4518. Callback = function(diff)
  4519. getgenv().difficulty = diff
  4520. updatejson()
  4521. end,
  4522. })
  4523.  
  4524. getgenv().leveldrop = autoFarmTab:CreateDropdown({
  4525. Name = "Select Level",
  4526. Options = getgenv().levels,
  4527. CurrentOption = getgenv().level,
  4528. Callback = function(level)
  4529. getgenv().level = level
  4530. updatejson()
  4531. end})
  4532.  
  4533.  
  4534. local worlddrop = autoFarmTab:CreateDropdown({
  4535. Name = "Select World",
  4536. Options = {"Planet Namak", "Shiganshinu District", "Snowy Town","Hidden Sand Village", "Marine's Ford",
  4537. "Ghoul City", "Hollow World", "Hollow Invasion", "Ant Kingdom", "Magic Town", "Cursed Academy","Clover Kingdom", "Clover Kingdom [Elf Invasion]", "Cape Canaveral","Cape Canaveral [Legend]", "Alien Ship"},
  4538. CurrentOption = getgenv().world,
  4539. Callback = function(world)
  4540. getgenv().world = world
  4541. updatejson()
  4542.  
  4543. if world == "Planet Namak" then
  4544. getgenv().leveldrop:Clear()
  4545. table.clear(levels)
  4546. getgenv().levels = {"namek_infinite", "namek_level_1", "namek_level_2", "namek_level_3",
  4547. "namek_level_4", "namek_level_5", "namek_level_6"}
  4548. for i, v in ipairs(levels) do
  4549. getgenv().leveldrop:Add(v)
  4550. end
  4551. elseif world == "Shiganshinu District" then
  4552. getgenv().leveldrop:Clear()
  4553. table.clear(levels)
  4554. getgenv().levels = {"aot_infinite", "aot_level_1", "aot_level_2", "aot_level_3", "aot_level_4",
  4555. "aot_level_5", "aot_level_6"}
  4556. for i, v in ipairs(levels) do
  4557. getgenv().leveldrop:Add(v)
  4558. end
  4559. elseif world == "Snowy Town" then
  4560. getgenv().leveldrop:Clear()
  4561. table.clear(levels)
  4562. getgenv().levels = {"demonslayer_infinite", "demonslayer_level_1", "demonslayer_level_2",
  4563. "demonslayer_level_3", "demonslayer_level_4", "demonslayer_level_5",
  4564. "demonslayer_level_6"}
  4565. for i, v in ipairs(levels) do
  4566. getgenv().leveldrop:Add(v)
  4567. end
  4568. elseif world == "Hidden Sand Village" then
  4569. getgenv().leveldrop:Clear()
  4570. table.clear(levels)
  4571. getgenv().levels = {"naruto_infinite", "naruto_level_1", "naruto_level_2", "naruto_level_3",
  4572. "naruto_level_4", "naruto_level_5", "naruto_level_6"}
  4573. for i, v in ipairs(levels) do
  4574. getgenv().leveldrop:Add(v)
  4575. end
  4576. elseif world == "Marine's Ford" then
  4577. getgenv().leveldrop:Clear()
  4578. table.clear(levels)
  4579. getgenv().levels = {"marineford_infinite","marineford_level_1","marineford_level_2","marineford_level_3",
  4580. "marineford_level_4","marineford_level_5","marineford_level_6"}
  4581. for i, v in ipairs(levels) do
  4582. getgenv().leveldrop:Add(v)
  4583. end
  4584. elseif world == "Ghoul City" then
  4585. getgenv().leveldrop:Clear()
  4586. table.clear(levels)
  4587. getgenv().levels = {"tokyoghoul_infinite","tokyoghoul_level_1","tokyoghoul_level_2","tokyoghoul_level_3",
  4588. "tokyoghoul_level_4","tokyoghoul_level_5","tokyoghoul_level_6"}
  4589. for i, v in ipairs(levels) do
  4590. getgenv().leveldrop:Add(v)
  4591. end
  4592. elseif world == "Hollow World" then
  4593. getgenv().leveldrop:Clear()
  4594. table.clear(levels)
  4595. getgenv().levels = {"hueco_infinite","hueco_level_1","hueco_level_2","hueco_level_3",
  4596. "hueco_level_4","hueco_level_5","hueco_level_6"}
  4597. for i, v in ipairs(levels) do
  4598. getgenv().leveldrop:Add(v)
  4599. end
  4600. elseif world == "Ant Kingdom" then
  4601. getgenv().leveldrop:Clear()
  4602. table.clear(levels)
  4603. getgenv().levels = {"hxhant_infinite","hxhant_level_1","hxhant_level_2","hxhant_level_3",
  4604. "hxhant_level_4","hxhant_level_5","hxhant_level_6"}
  4605. for i, v in ipairs(levels) do
  4606. getgenv().leveldrop:Add(v)
  4607. end
  4608.  
  4609. elseif world == "Magic Town" then
  4610. getgenv().leveldrop:Clear()
  4611. table.clear(levels)
  4612. getgenv().levels = {"magnolia_infinite","magnolia_level_1","magnolia_level_2","magnolia_level_3",
  4613. "magnolia_level_4","magnolia_level_5","magnolia_level_6"}
  4614. for i, v in ipairs(levels) do
  4615. getgenv().leveldrop:Add(v)
  4616. end
  4617. elseif world == "Cursed Academy" then
  4618. getgenv().leveldrop:Clear()
  4619. table.clear(levels)
  4620. getgenv().levels = {"jjk_infinite","jjk_level_1","jjk_level_2","jjk_level_3",
  4621. "jjk_level_4","jjk_level_5","jjk_level_6","jjk_finger"}
  4622. for i, v in ipairs(levels) do
  4623. getgenv().leveldrop:Add(v)
  4624. end
  4625. elseif world == "Clover Kingdom" then
  4626. getgenv().leveldrop:Clear()
  4627. table.clear(levels)
  4628. getgenv().levels = {"clover_infinite","clover_level_1","clover_level_2","clover_level_3",
  4629. "clover_level_4","clover_level_5","clover_level_6",}
  4630. for i, v in ipairs(levels) do
  4631. getgenv().leveldrop:Add(v)
  4632. end
  4633. elseif world == "Clover Legend - HARD" then
  4634. getgenv().leveldrop:Clear()
  4635. table.clear(levels)
  4636. getgenv().levels = {"clover_legend_1","clover_legend_2","clover_legend_3",}
  4637. for i, v in ipairs(levels) do
  4638. getgenv().leveldrop:Add(v)
  4639. end
  4640. elseif world == "Hollow Legend - HARD" then
  4641. getgenv().leveldrop:Clear()
  4642. table.clear(levels)
  4643. getgenv().levels = {"bleach_legend_1","bleach_legend_2","bleach_legend_3","bleach_legend_4","bleach_legend_5","bleach_legend_6"}
  4644. for i, v in ipairs(levels) do
  4645. getgenv().leveldrop:Add(v)
  4646. end
  4647. elseif world == "Cape Canaveral" then
  4648. getgenv().leveldrop:Clear()
  4649. table.clear(levels)
  4650. getgenv().levels = {"jojo_infinite","jojo_level_1","jojo_level_2","jojo_level_3","jojo_level_4","jojo_level_5","jojo_level_6",}
  4651. for i, v in ipairs(levels) do
  4652. getgenv().leveldrop:Add(v)
  4653. end
  4654. elseif world == "Alien Ship" then
  4655. getgenv().leveldrop:Clear()
  4656. table.clear(levels)
  4657. getgenv().levels = {"opm_infinite","opm_level_1","opm_level_2","opm_level_3","opm_level_4","opm_level_5","opm_level_6","opm_portal_g"}
  4658. for i, v in ipairs(levels) do
  4659. getgenv().leveldrop:Add(v)
  4660. end
  4661. elseif world == "Clover Kingdom [Elf Invasion]" then
  4662. getgenv().leveldrop:Clear()
  4663. table.clear(levels)
  4664. getgenv().levels = {"clover_legend_1","clover_legend_2","clover_legend_3",}
  4665. for i, v in ipairs(levels) do
  4666. getgenv().leveldrop:Add(v)
  4667. end
  4668. elseif world == "Hollow Invasion" then
  4669. getgenv().leveldrop:Clear()
  4670. table.clear(levels)
  4671. getgenv().levels = {"bleach_legend_1","bleach_legend_2","bleach_legend_3","bleach_legend_4","bleach_legend_5","bleach_legend_6"}
  4672. for i, v in ipairs(levels) do
  4673. getgenv().leveldrop:Add(v)
  4674. end
  4675. elseif world == "Cape Canaveral [Legend]" then
  4676. getgenv().leveldrop:Clear()
  4677. table.clear(levels)
  4678. getgenv().levels = {"jojo_legend_1","jojo_legend_2","jojo_legend_3","jojo_portal_pucci"}
  4679. for i, v in ipairs(levels) do
  4680. getgenv().leveldrop:Add(v)
  4681. end
  4682. end
  4683. end})
  4684.  
  4685. getgenv().raiddrop = autoFarmTab:CreateDropdown({
  4686. Name = "Select Raid Level",
  4687. Options = getgenv().raidLevels,
  4688. CurrentOption = getgenv().raidLevel,
  4689. Callback = function(raidLevel)
  4690. getgenv().raidLevel = raidLevel
  4691. updatejson()
  4692. end})
  4693.  
  4694. local raiddrop = autoFarmTab:CreateDropdown({
  4695. Name = "Select Raid World",
  4696. Options = {"Storm Hideout", "West City", "Infinity Train", "Shiganshinu District [Raid]","Hidden Sand Village [Raid]"},
  4697. CurrentOption = getgenv().raidWorld,
  4698. Callback = function(raidWorld)
  4699. getgenv().raidWorld = raidWorld
  4700. updatejson()
  4701.  
  4702. if raidWorld == "Storm Hideout" then
  4703. getgenv().raiddrop:Clear()
  4704. getgenv().raidLevels = {"uchiha_level_1","uchiha_level_2","uchiha_level_3","uchiha_level_4","uchiha_level_5"}
  4705. for i, v in ipairs(getgenv().raidLevels) do
  4706. getgenv().raiddrop:Add(v)
  4707. end
  4708. elseif raidWorld == "West City" then
  4709. getgenv().raiddrop:Clear()
  4710. getgenv().raidLevels = {"west_city_raid"}
  4711. for i, v in ipairs(getgenv().raidLevels) do
  4712. getgenv().raiddrop:Add(v)
  4713. end
  4714. elseif raidWorld == "Infinity Train" then
  4715. getgenv().raiddrop:Clear()
  4716. getgenv().raidLevels = {"demonslayer_raid_1"}
  4717. for i, v in ipairs(getgenv().raidLevels) do
  4718. getgenv().raiddrop:Add(v)
  4719. end
  4720. elseif raidWorld == "Shiganshinu District [Raid]" then
  4721. getgenv().raiddrop:Clear()
  4722. getgenv().raidLevels = {"aot_raid_1"}
  4723. for i, v in ipairs(getgenv().raidLevels) do
  4724. getgenv().raiddrop:Add(v)
  4725. end
  4726. elseif raidWorld == "Hidden Sand Village [Raid]" then
  4727. getgenv().raiddrop:Clear()
  4728. getgenv().raidLevels = {"naruto_raid_1"}
  4729. for i, v in ipairs(getgenv().raidLevels) do
  4730. getgenv().raiddrop:Add(v)
  4731. end
  4732. end
  4733. end})
  4734.  
  4735. --------------------------------------------------
  4736. ------------------ Auto Farm Tab -----------------
  4737. --------------------------------------------------
  4738.  
  4739. local autoFarmSection = autoFarmTab:CreateSection("Auto-Farm")
  4740.  
  4741. autoFarmTab:CreateToggle({
  4742. Name = "Alt Mode",
  4743. CurrentValue = getgenv().altMode,
  4744. Callback = function(bool)
  4745. getgenv().altMode = bool
  4746. updatejson()
  4747. end})
  4748.  
  4749. autoFarmTab:CreateToggle({
  4750. Name = "Auto Continue",
  4751. CurrentValue = getgenv().AutoContinue,
  4752. Callback = function(bool)
  4753. getgenv().AutoContinue = bool
  4754. updatejson()
  4755. end})
  4756.  
  4757. autoFarmTab:CreateToggle({
  4758. Name = "Auto Replay",
  4759. CurrentValue = getgenv().AutoReplay,
  4760. Callback = function(bool)
  4761. getgenv().AutoReplay = bool
  4762. updatejson()
  4763. end})
  4764.  
  4765. autoFarmTab:CreateToggle({
  4766. Name = "Auto Leave",
  4767. CurrentValue = getgenv().AutoLeave,
  4768. Callback = function(bool)
  4769. getgenv().AutoLeave = bool
  4770. updatejson()
  4771. end})
  4772.  
  4773. autoFarmTab:CreateToggle({
  4774. Name = "Auto Farm Event",
  4775. CurrentValue = getgenv().AutoFarmTP,
  4776. Callback = function(bool)
  4777. getgenv().AutoFarmTP = bool
  4778. updatejson()
  4779. end})
  4780.  
  4781. autoFarmTab:CreateToggle({
  4782. Name = "Auto Raid",
  4783. CurrentValue = getgenv().autoRaid,
  4784. Callback = function(bool)
  4785. getgenv().autoRaid = bool
  4786. updatejson()
  4787. end})
  4788.  
  4789. autoFarmTab:CreateToggle({
  4790. Name = "Auto Farm OPM Portals",
  4791. CurrentValue = getgenv().autoPortal,
  4792. Callback = function(bool)
  4793. getgenv().autoPortal = bool
  4794. updatejson()
  4795. end})
  4796.  
  4797. autoFarmTab:CreateToggle({
  4798. Name = "Auto Farm CSM Portals",
  4799. CurrentValue = getgenv().autoPortalCSM,
  4800. Callback = function(bool)
  4801. getgenv().autoPortalCSM = bool
  4802. updatejson()
  4803. end})
  4804.  
  4805. autoFarmTab:CreateToggle({
  4806. Name = "Auto Start Infinity Castle",
  4807. CurrentValue = getgenv().AutoFarmIC,
  4808. Callback = function(bool)
  4809. getgenv().AutoFarmIC = bool
  4810. updatejson()
  4811. end})
  4812.  
  4813. autoFarmTab:CreateToggle({
  4814. Name = "Auto Farm",
  4815. CurrentValue = getgenv().AutoFarm,
  4816. Callback = function(bool)
  4817. getgenv().AutoFarm = bool
  4818. updatejson()
  4819. end})
  4820.  
  4821. autoFarmTab:CreateToggle({
  4822. Name = "Auto Start",
  4823. CurrentValue = getgenv().autoStart,
  4824. Callback = function(bool)
  4825. getgenv().autoStart = bool
  4826. updatejson()
  4827. end})
  4828.  
  4829. autoFarmTab:CreateToggle({
  4830. Name = "Auto Abilities",
  4831. CurrentValue = getgenv().autoabilities,
  4832. Callback = function(bool)
  4833. getgenv().autoabilities = bool
  4834. updatejson()
  4835. end})
  4836.  
  4837. autoFarmTab:CreateToggle({
  4838. Name = "Auto Upgrade Units",
  4839. CurrentValue = getgenv().autoUpgrade,
  4840. Callback = function(bool)
  4841. getgenv().autoUpgrade = bool
  4842. updatejson()
  4843. end})
  4844.  
  4845. autoFarmTab:CreateToggle({
  4846. Name = "Auto Sell at Specific Wave",
  4847. CurrentValue = getgenv().autoSell,
  4848. Callback = function(bool)
  4849. getgenv().autoSell = bool
  4850. updatejson()
  4851. if getgenv().autoSell == false then
  4852. getgenv().disableAutoFarm = false
  4853. end
  4854. end})
  4855.  
  4856. autoFarmTab:CreateToggle({
  4857. Name = "Auto Quit at Specific Wave",
  4858. CurrentValue = getgenv().autoQuit,
  4859. Callback = function(bool)
  4860. getgenv().autoQuit = bool
  4861. updatejson()
  4862. end})
  4863.  
  4864. autoFarmTab:CreateInput({
  4865. Name = "Select Wave Number for Auto Sell {Press Enter}",
  4866. PlaceholderText = tostring(getgenv().sellatwave),
  4867. RemoveTextAfterFocusLost = false,
  4868. Callback = function(t)
  4869. getgenv().sellatwave = tonumber(t)
  4870. updatejson()
  4871. end})
  4872.  
  4873. autoFarmTab:CreateInput({
  4874. Name = "Select Wave Number for Auto Quit {Press Enter}",
  4875. PlaceholderText = tostring(getgenv().quitAtWave),
  4876. RemoveTextAfterFocusLost = false,
  4877. Callback = function(t)
  4878. getgenv().quitAtWave = tonumber(t)
  4879. updatejson()
  4880. end})
  4881.  
  4882. local autoLoadSection = autoFarmTab:CreateSection("Auto Load Script")
  4883. autoFarmTab:CreateLabel("This Automatically executes script when you teleport to the main area.")
  4884. autoFarmTab:CreateLabel("You don't need to put the script in your autoexec folder!")
  4885. autoFarmTab:CreateToggle({
  4886. Name = "Auto Load Script",
  4887. CurrentValue = getgenv().AutoLoadTP,
  4888. Callback = function(bool)
  4889. getgenv().AutoLoadTP = bool
  4890. updatejson()
  4891. if exec == "Synapse X" and getgenv().AutoLoadTP then
  4892. syn.queue_on_teleport("loadstring(game:HttpGet('https://raw.githubusercontent.com/Tesseract1234567890/animeadv/main/script.lua'))()")
  4893.  
  4894. if exec == "Synapse X" then
  4895. syn.queue_on_teleport("loadstring(game:HttpGet('https://raw.githubusercontent.com/Tesseract1234567890/animeadv/main/script.lua'))()")
  4896. RayfieldLib:Notify({
  4897. Title = "Queued to Auto-Attach on Teleport!",
  4898. Content = "Success",
  4899. Duration = 6.5,
  4900. Actions = { -- Notification Buttons
  4901. Ignore = {
  4902. Name = "Okay!",
  4903. Callback = function()
  4904. print("The user tapped Okay!")
  4905. end
  4906. }
  4907. }
  4908. })
  4909. end
  4910.  
  4911. elseif exec ~= "Synapse X" and getgenv().AutoLoadTP then
  4912. queue_on_teleport("loadstring(game:HttpGet('https://raw.githubusercontent.com/Tesseract1234567890/animeadv/main/script.lua'))()")
  4913. end
  4914.  
  4915. end})
  4916. autoFarmTab:CreateLabel("If it doesn't work properly, then put the script in autoexec folder.")
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922. --------------------------------------------
  4923.  
  4924. local autoChallengeSection = autoFarmTab:CreateSection("Auto-Challenge")
  4925.  
  4926. autoFarmTab:CreateToggle({
  4927. Name = "Auto Challenge",
  4928. CurrentValue = getgenv().AutoChallenge,
  4929. Callback = function(bool)
  4930. getgenv().AutoChallenge = bool
  4931. updatejson()
  4932. end})
  4933.  
  4934. local worlddrop = autoFarmTab:CreateDropdown({
  4935. Name = "Select Reward",
  4936. Options = {"star_fruit_random","star_remnant","gems", "gold"},
  4937. CurrentOption = getgenv().selectedreward,
  4938. Callback = function(reward)
  4939. getgenv().selectedreward = reward
  4940. updatejson()
  4941. end})
  4942.  
  4943. autoFarmTab:CreateToggle({
  4944. Name = "Farm All Rewards",
  4945. CurrentValue = getgenv().AutoChallengeAll,
  4946. Callback = function(bool)
  4947. getgenv().AutoChallengeAll = bool
  4948. updatejson()
  4949. end})
  4950.  
  4951. getgenv().UnitSellTog = false
  4952. getgenv().autosummontickets = false
  4953. getgenv().autosummongem = false
  4954. getgenv().autosummongem10 = false
  4955.  
  4956. getgenv().autosummonticketse = false
  4957. getgenv().autosummongeme = false
  4958. getgenv().autosummongem10e = false
  4959.  
  4960. local autoBuySellSection = autoFarmTab:CreateSection("Auto Buy/Sell")
  4961.  
  4962.  
  4963. local function autobuyfunc(xx, item)
  4964. task.wait()
  4965.  
  4966. local args = {
  4967. [1] = xx,
  4968. [2] = item
  4969. }
  4970. game:GetService("ReplicatedStorage").endpoints.client_to_server.buy_from_banner:InvokeServer(unpack(args))
  4971.  
  4972. end
  4973.  
  4974. autoFarmTab:CreateLabel("Special Banner - 2x Mythic")
  4975. autoFarmTab:CreateToggle({
  4976. Name = "Auto Summon {Use Ticket}",
  4977. CurrentValue = getgenv().autosummonticketse,
  4978. Callback = function(bool)
  4979. getgenv().autosummonticketse = bool
  4980. while getgenv().autosummonticketse do
  4981. autobuyfunc("EventClover", "ticket")
  4982. end
  4983. updatejson()
  4984. end})
  4985.  
  4986. autoFarmTab:CreateToggle({
  4987. Name = "Auto Summon {Buy 1}",
  4988. CurrentValue = getgenv().autosummongeme,
  4989. Callback = function(bool)
  4990. getgenv().autosummongeme = bool
  4991. while getgenv().autosummongeme do
  4992. autobuyfunc("EventClover", "gems")
  4993. end
  4994. updatejson()
  4995. end})
  4996.  
  4997. autoFarmTab:CreateToggle({
  4998. Name = "Auto Summon {Buy 10}",
  4999. CurrentValue = getgenv().autosummongem10e,
  5000. Callback = function(bool)
  5001. getgenv().autosummongem10e = bool
  5002. while getgenv().autosummongem10e do
  5003. autobuyfunc("EventClover", "gems10")
  5004. end
  5005. updatejson()
  5006. end})
  5007.  
  5008. autoFarmTab:CreateLabel("Standard Banner")
  5009.  
  5010. autoFarmTab:CreateToggle({
  5011. Name = "Auto Summon {Use Ticket}",
  5012. CurrentValue = getgenv().autosummontickets,
  5013. Callback = function(bool)
  5014. getgenv().autosummontickets = bool
  5015. while getgenv().autosummontickets do
  5016. autobuyfunc("Standard", "ticket")
  5017. end
  5018. updatejson()
  5019. end})
  5020.  
  5021. autoFarmTab:CreateToggle({
  5022. Name = "Auto Summon {Buy 1}",
  5023. CurrentValue = getgenv().autosummongem,
  5024. Callback = function(bool)
  5025. getgenv().autosummongem = bool
  5026. while getgenv().autosummongem do
  5027. autobuyfunc("Standard", "gems")
  5028. end
  5029. updatejson()
  5030. end})
  5031.  
  5032. autoFarmTab:CreateToggle({
  5033. Name = "Auto Summon {Buy 10}",
  5034. CurrentValue = getgenv().autosummongem10,
  5035. Callback = function(bool)
  5036. getgenv().autosummongem10 = bool
  5037. while getgenv().autosummongem10 do
  5038. autobuyfunc("Standard", "gems10")
  5039. end
  5040. updatejson()
  5041. end})
  5042.  
  5043. autoFarmTab:CreateLabel("Sell Units")
  5044. local utts = autoFarmTab:CreateDropdown({
  5045. Name = "Select Rarity",
  5046. Options = {"Rare", "Epic"},
  5047. CurrentOption = tostring(getgenv().UnitToSell),
  5048. Callback = function(u)
  5049. getgenv().UnitToSell = u
  5050. end})
  5051.  
  5052. autoFarmTab:CreateToggle({
  5053. Name = "Auto Sell Units",
  5054. CurrentValue = getgenv().UnitSellTog,
  5055. Callback = function(bool)
  5056. getgenv().UnitSellTog = bool
  5057. end})
  5058.  
  5059. local webhookSection = webhookTab:CreateSection("Webhooks")
  5060.  
  5061. webhookTab:CreateLabel("Webhooks send notifications in Discord everytime a game is finished!")
  5062.  
  5063. local webhookPlaceholder
  5064.  
  5065. if getgenv().webUrl == "" then
  5066. webhookPlaceholder = "Insert URL here!"
  5067. else
  5068. webhookPlaceholder = "Good to go!"
  5069. end
  5070. webhookTab:CreateInput({
  5071. Name = "Webhook URL {Press Enter}" ,
  5072. PlaceholderText = webhookPlaceholder,
  5073. RemoveTextAfterFocusLost = false,
  5074. Callback = function(web_url)
  5075. getgenv().webUrl = web_url
  5076. updatejson()
  5077. end})
  5078.  
  5079. local sniperWebhookPlaceholder
  5080. if getgenv().sniperUrl == "" then
  5081. sniperWebhookPlaceholder = "Insert URL here!"
  5082. else
  5083. sniperWebhookPlaceholder = "Good to go!"
  5084. end
  5085.  
  5086. webhookTab:CreateInput({
  5087. Name = "Sniper Webhook URL {Press Enter}" ,
  5088. PlaceholderText = sniperWebhookPlaceholder,
  5089. RemoveTextAfterFocusLost = false,
  5090. Callback = function(sniper_url)
  5091. getgenv().sniperUrl = sniper_url
  5092. updatejson()
  5093. end})
  5094.  
  5095. webhookTab:CreateButton({
  5096. Name = "Test Regular Webhooks",
  5097. Callback = function()
  5098. Webhook()
  5099. BabyWebhook()
  5100. NormalItemWebhook(true)
  5101. UniqueItemWebhook(true)
  5102. end})
  5103.  
  5104. webhookTab:CreateButton({
  5105. Name = "Test Sniper Webhooks",
  5106. Callback = function()
  5107. ShopSniperWebhook(true)
  5108. SpecialSummonSniperWebhook(true)
  5109. StandardSummonSniperWebhook(true)
  5110. end})
  5111.  
  5112.  
  5113. else -- When in a match
  5114. getgenv().lockAutoFunctions = false
  5115. updatejson()
  5116.  
  5117. unitPlacementTab = mainWindow:CreateTab("Unit Placement Settings")
  5118. local Paragraph = unitPlacementTab:CreateParagraph({Title = "How to Use",
  5119. Content = "Placement Priority: If multiple units can be placed with current money, prioritizes higher numbered unit.\nUpgrade Priority: Same concept as Placement Priority.\nPlace From Wave: Will not place a unit until this wave.\nUpgrade From Wave: Will not upgrade a unit until this wave.\nUpgrade Cap: Will not upgrade a unit past this level."})
  5120. unitOneSection = unitPlacementTab:CreateSection("Unit 1 - " .. getgenv().SelectedUnits["U1"]:split(" #")[1])
  5121.  
  5122. unitOnePlacementPriority = unitPlacementTab:CreateInput({
  5123. Name = "Placement Priority",
  5124. PlaceholderText = getgenv().unitPlacementSettings["U1"]["placementPriority"],
  5125. RemoveTextAfterFocusLost = false,
  5126. Callback = function(placementPriority)
  5127. getgenv().unitPlacementSettings["U1"]["placementPriority"] = placementPriority
  5128. updatejson()
  5129. end,
  5130. })
  5131.  
  5132. unitOneUpgradePriority = unitPlacementTab:CreateInput({
  5133. Name = "Upgrade Priority",
  5134. PlaceholderText = getgenv().unitPlacementSettings["U1"]["upgradePriority"],
  5135. RemoveTextAfterFocusLost = false,
  5136. Callback = function(upgradePriority)
  5137. getgenv().unitPlacementSettings["U1"]["upgradePriority"] = upgradePriority
  5138. updatejson()
  5139. end,
  5140. })
  5141.  
  5142. unitOnePlaceFromWave = unitPlacementTab:CreateInput({
  5143. Name = "Place From Wave",
  5144. PlaceholderText = getgenv().unitPlacementSettings["U1"]["placeFromWave"],
  5145. RemoveTextAfterFocusLost = false,
  5146. Callback = function(placeFromWave)
  5147. getgenv().unitPlacementSettings["U1"]["placeFromWave"] = placeFromWave
  5148. updatejson()
  5149. end,
  5150. })
  5151.  
  5152. unitOneUpgradeFromWave = unitPlacementTab:CreateInput({
  5153. Name = "Upgrade From Wave",
  5154. PlaceholderText = getgenv().unitPlacementSettings["U1"]["upgradeFromWave"],
  5155. RemoveTextAfterFocusLost = false,
  5156. Callback = function(upgradeFromWave)
  5157. getgenv().unitPlacementSettings["U1"]["upgradeFromWave"] = upgradeFromWave
  5158. updatejson()
  5159. end,
  5160. })
  5161.  
  5162. unitOneUpgradeCap = unitPlacementTab:CreateInput({
  5163. Name = "Upgrade Cap",
  5164. PlaceholderText = getgenv().unitPlacementSettings["U1"]["upgradeCap"],
  5165. RemoveTextAfterFocusLost = false,
  5166. Callback = function(upgradeCap)
  5167. getgenv().unitPlacementSettings["U1"]["upgradeCap"] = upgradeCap
  5168. updatejson()
  5169. end,
  5170. })
  5171.  
  5172. unitTwoSection = unitPlacementTab:CreateSection("Unit 2 - " .. getgenv().SelectedUnits["U2"]:split(" #")[1])
  5173.  
  5174. unitTwoPlacementPriority = unitPlacementTab:CreateInput({
  5175. Name = "Placement Priority",
  5176. PlaceholderText = getgenv().unitPlacementSettings["U2"]["placementPriority"],
  5177. RemoveTextAfterFocusLost = false,
  5178. Callback = function(placementPriority)
  5179. getgenv().unitPlacementSettings["U2"]["placementPriority"] = placementPriority
  5180. updatejson()
  5181. end,
  5182. })
  5183.  
  5184. unitTwoUpgradePriority = unitPlacementTab:CreateInput({
  5185. Name = "Upgrade Priority",
  5186. PlaceholderText = getgenv().unitPlacementSettings["U2"]["upgradePriority"],
  5187. RemoveTextAfterFocusLost = false,
  5188. Callback = function(upgradePriority)
  5189. getgenv().unitPlacementSettings["U2"]["upgradePriority"] = upgradePriority
  5190. updatejson()
  5191. end,
  5192. })
  5193.  
  5194. unitTwoPlaceFromWave = unitPlacementTab:CreateInput({
  5195. Name = "Place From Wave",
  5196. PlaceholderText = getgenv().unitPlacementSettings["U2"]["placeFromWave"],
  5197. RemoveTextAfterFocusLost = false,
  5198. Callback = function(placeFromWave)
  5199. getgenv().unitPlacementSettings["U2"]["placeFromWave"] = placeFromWave
  5200. updatejson()
  5201. end,
  5202. })
  5203.  
  5204. unitTwoUpgradeFromWave = unitPlacementTab:CreateInput({
  5205. Name = "Upgrade From Wave",
  5206. PlaceholderText = getgenv().unitPlacementSettings["U2"]["upgradeFromWave"],
  5207. RemoveTextAfterFocusLost = false,
  5208. Callback = function(upgradeFromWave)
  5209. getgenv().unitPlacementSettings["U2"]["upgradeFromWave"] = upgradeFromWave
  5210. updatejson()
  5211. end,
  5212. })
  5213.  
  5214. unitTwoUpgradeCap = unitPlacementTab:CreateInput({
  5215. Name = "Upgrade Cap",
  5216. PlaceholderText = getgenv().unitPlacementSettings["U2"]["upgradeCap"],
  5217. RemoveTextAfterFocusLost = false,
  5218. Callback = function(upgradeCap)
  5219. getgenv().unitPlacementSettings["U2"]["upgradeCap"] = upgradeCap
  5220. updatejson()
  5221. end,
  5222. })
  5223.  
  5224. unitThreeSection = unitPlacementTab:CreateSection("Unit 3 - " .. getgenv().SelectedUnits["U3"]:split(" #")[1])
  5225.  
  5226. unitThreePlacementPriority = unitPlacementTab:CreateInput({
  5227. Name = "Placement Priority",
  5228. PlaceholderText = getgenv().unitPlacementSettings["U3"]["placementPriority"],
  5229. RemoveTextAfterFocusLost = false,
  5230. Callback = function(placementPriority)
  5231. getgenv().unitPlacementSettings["U3"]["placementPriority"] = placementPriority
  5232. updatejson()
  5233. end,
  5234. })
  5235.  
  5236. unitThreeUpgradePriority = unitPlacementTab:CreateInput({
  5237. Name = "Upgrade Priority",
  5238. PlaceholderText = getgenv().unitPlacementSettings["U3"]["upgradePriority"],
  5239. RemoveTextAfterFocusLost = false,
  5240. Callback = function(upgradePriority)
  5241. getgenv().unitPlacementSettings["U3"]["upgradePriority"] = upgradePriority
  5242. updatejson()
  5243. end,
  5244. })
  5245.  
  5246. unitThreePlaceFromWave = unitPlacementTab:CreateInput({
  5247. Name = "Place From Wave",
  5248. PlaceholderText = getgenv().unitPlacementSettings["U3"]["placeFromWave"],
  5249. RemoveTextAfterFocusLost = false,
  5250. Callback = function(placeFromWave)
  5251. getgenv().unitPlacementSettings["U3"]["placeFromWave"] = placeFromWave
  5252. updatejson()
  5253. end,
  5254. })
  5255.  
  5256. unitThreeUpgradeFromWave = unitPlacementTab:CreateInput({
  5257. Name = "Upgrade From Wave",
  5258. PlaceholderText = getgenv().unitPlacementSettings["U3"]["upgradeFromWave"],
  5259. RemoveTextAfterFocusLost = false,
  5260. Callback = function(upgradeFromWave)
  5261. getgenv().unitPlacementSettings["U3"]["upgradeFromWave"] = upgradeFromWave
  5262. updatejson()
  5263. end,
  5264. })
  5265.  
  5266. unitThreeUpgradeCap = unitPlacementTab:CreateInput({
  5267. Name = "Upgrade Cap",
  5268. PlaceholderText = getgenv().unitPlacementSettings["U3"]["upgradeCap"],
  5269. RemoveTextAfterFocusLost = false,
  5270. Callback = function(upgradeCap)
  5271. getgenv().unitPlacementSettings["U3"]["upgradeCap"] = upgradeCap
  5272. updatejson()
  5273. end,
  5274. })
  5275.  
  5276. unitFourSection = unitPlacementTab:CreateSection("Unit 4 - " .. getgenv().SelectedUnits["U4"]:split(" #")[1])
  5277.  
  5278. unitFourPlacementPriority = unitPlacementTab:CreateInput({
  5279. Name = "Placement Priority",
  5280. PlaceholderText = getgenv().unitPlacementSettings["U4"]["placementPriority"],
  5281. RemoveTextAfterFocusLost = false,
  5282. Callback = function(placementPriority)
  5283. getgenv().unitPlacementSettings["U4"]["placementPriority"] = placementPriority
  5284. updatejson()
  5285. end,
  5286. })
  5287.  
  5288. unitFourUpgradePriority = unitPlacementTab:CreateInput({
  5289. Name = "Upgrade Priority",
  5290. PlaceholderText = getgenv().unitPlacementSettings["U4"]["upgradePriority"],
  5291. RemoveTextAfterFocusLost = false,
  5292. Callback = function(upgradePriority)
  5293. getgenv().unitPlacementSettings["U4"]["upgradePriority"] = upgradePriority
  5294. updatejson()
  5295. end,
  5296. })
  5297.  
  5298. unitFourPlaceFromWave = unitPlacementTab:CreateInput({
  5299. Name = "Place From Wave",
  5300. PlaceholderText = getgenv().unitPlacementSettings["U4"]["placeFromWave"],
  5301. RemoveTextAfterFocusLost = false,
  5302. Callback = function(placeFromWave)
  5303. getgenv().unitPlacementSettings["U4"]["placeFromWave"] = placeFromWave
  5304. updatejson()
  5305. end,
  5306. })
  5307.  
  5308. unitFourUpgradeFromWave = unitPlacementTab:CreateInput({
  5309. Name = "Upgrade From Wave",
  5310. PlaceholderText = getgenv().unitPlacementSettings["U4"]["upgradeFromWave"],
  5311. RemoveTextAfterFocusLost = false,
  5312. Callback = function(upgradeFromWave)
  5313. getgenv().unitPlacementSettings["U4"]["upgradeFromWave"] = upgradeFromWave
  5314. updatejson()
  5315. end,
  5316. })
  5317.  
  5318. unitFourUpgradeCap = unitPlacementTab:CreateInput({
  5319. Name = "Upgrade Cap",
  5320. PlaceholderText = getgenv().unitPlacementSettings["U4"]["upgradeCap"],
  5321. RemoveTextAfterFocusLost = false,
  5322. Callback = function(upgradeCap)
  5323. getgenv().unitPlacementSettings["U4"]["upgradeCap"] = upgradeCap
  5324. updatejson()
  5325. end,
  5326. })
  5327.  
  5328. if tonumber(game.Players.LocalPlayer.PlayerGui["spawn_units"].Lives.Main.Desc.Level.Text:split(" ")[2]) >= 20 then
  5329. unitFiveSection = unitPlacementTab:CreateSection("Unit 5 - " .. getgenv().SelectedUnits["U5"]:split(" #")[1])
  5330.  
  5331. unitFivePlacementPriority = unitPlacementTab:CreateInput({
  5332. Name = "Placement Priority",
  5333. PlaceholderText = getgenv().unitPlacementSettings["U5"]["placementPriority"],
  5334. RemoveTextAfterFocusLost = false,
  5335. Callback = function(placementPriority)
  5336. getgenv().unitPlacementSettings["U5"]["placementPriority"] = placementPriority
  5337. updatejson()
  5338. end,
  5339. })
  5340.  
  5341. unitFiveUpgradePriority = unitPlacementTab:CreateInput({
  5342. Name = "Upgrade Priority",
  5343. PlaceholderText = getgenv().unitPlacementSettings["U5"]["upgradePriority"],
  5344. RemoveTextAfterFocusLost = false,
  5345. Callback = function(upgradePriority)
  5346. getgenv().unitPlacementSettings["U5"]["upgradePriority"] = upgradePriority
  5347. updatejson()
  5348. end,
  5349. })
  5350.  
  5351. unitFivePlaceFromWave = unitPlacementTab:CreateInput({
  5352. Name = "Place From Wave",
  5353. PlaceholderText = getgenv().unitPlacementSettings["U5"]["placeFromWave"],
  5354. RemoveTextAfterFocusLost = false,
  5355. Callback = function(placeFromWave)
  5356. getgenv().unitPlacementSettings["U5"]["placeFromWave"] = placeFromWave
  5357. updatejson()
  5358. end,
  5359. })
  5360.  
  5361. unitFiveUpgradeFromWave = unitPlacementTab:CreateInput({
  5362. Name = "Upgrade From Wave",
  5363. PlaceholderText = getgenv().unitPlacementSettings["U5"]["upgradeFromWave"],
  5364. RemoveTextAfterFocusLost = false,
  5365. Callback = function(upgradeFromWave)
  5366. getgenv().unitPlacementSettings["U5"]["upgradeFromWave"] = upgradeFromWave
  5367. updatejson()
  5368. end,
  5369. })
  5370.  
  5371. unitFiveUpgradeCap = unitPlacementTab:CreateInput({
  5372. Name = "Upgrade Cap",
  5373. PlaceholderText = getgenv().unitPlacementSettings["U5"]["upgradeCap"],
  5374. RemoveTextAfterFocusLost = false,
  5375. Callback = function(upgradeCap)
  5376. getgenv().unitPlacementSettings["U5"]["upgradeCap"] = upgradeCap
  5377. updatejson()
  5378. end,
  5379. })
  5380. end
  5381.  
  5382. if tonumber(game.Players.LocalPlayer.PlayerGui["spawn_units"].Lives.Main.Desc.Level.Text:split(" ")[2]) >= 50 then
  5383. unitSixSection = unitPlacementTab:CreateSection("Unit 6 - " .. getgenv().SelectedUnits["U6"]:split(" #")[1])
  5384.  
  5385. unitSixPlacementPriority = unitPlacementTab:CreateInput({
  5386. Name = "Placement Priority",
  5387. PlaceholderText = getgenv().unitPlacementSettings["U6"]["placementPriority"],
  5388. RemoveTextAfterFocusLost = false,
  5389. Callback = function(placementPriority)
  5390. getgenv().unitPlacementSettings["U6"]["placementPriority"] = placementPriority
  5391. updatejson()
  5392. end,
  5393. })
  5394.  
  5395. unitSixUpgradePriority = unitPlacementTab:CreateInput({
  5396. Name = "Upgrade Priority",
  5397. PlaceholderText = getgenv().unitPlacementSettings["U6"]["upgradePriority"],
  5398. RemoveTextAfterFocusLost = false,
  5399. Callback = function(upgradePriority)
  5400. getgenv().unitPlacementSettings["U6"]["upgradePriority"] = upgradePriority
  5401. updatejson()
  5402. end,
  5403. })
  5404.  
  5405. unitSixPlaceFromWave = unitPlacementTab:CreateInput({
  5406. Name = "Place From Wave",
  5407. PlaceholderText = getgenv().unitPlacementSettings["U6"]["placeFromWave"],
  5408. RemoveTextAfterFocusLost = false,
  5409. Callback = function(placeFromWave)
  5410. getgenv().unitPlacementSettings["U6"]["placeFromWave"] = placeFromWave
  5411. updatejson()
  5412. end,
  5413. })
  5414.  
  5415. unitSixUpgradeFromWave = unitPlacementTab:CreateInput({
  5416. Name = "Upgrade From Wave",
  5417. PlaceholderText = getgenv().unitPlacementSettings["U6"]["upgradeFromWave"],
  5418. RemoveTextAfterFocusLost = false,
  5419. Callback = function(upgradeFromWave)
  5420. getgenv().unitPlacementSettings["U6"]["upgradeFromWave"] = upgradeFromWave
  5421. updatejson()
  5422. end,
  5423. })
  5424.  
  5425. unitSixUpgradeCap = unitPlacementTab:CreateInput({
  5426. Name = "Upgrade Cap",
  5427. PlaceholderText = getgenv().unitPlacementSettings["U6"]["upgradeCap"],
  5428. RemoveTextAfterFocusLost = false,
  5429. Callback = function(upgradeCap)
  5430. getgenv().unitPlacementSettings["U6"]["upgradeCap"] = upgradeCap
  5431. updatejson()
  5432. end,
  5433. })
  5434. end
  5435.  
  5436. if getgenv().recordMacroOnTeleport then
  5437. getgenv().lockAutoFunctions = true
  5438. getgenv().recordMacroOnTeleport = false
  5439. getgenv().recordingMacro = true
  5440. updatejson()
  5441. else
  5442. --getgenv().recordingMacro = false
  5443. updatejson()
  5444. end
  5445.  
  5446. if getgenv().replayMacroOnTeleport then
  5447. print("MACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAAMACRO STARTED AAAAAA")
  5448. print("SESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSESSES")
  5449. getgenv().lockAutoFunctions = true
  5450. coroutine.resume(coroutine.create(function()
  5451. getgenv().lockAutoFunctions = true
  5452. if getgenv().levelMacros[tostring(workspace._MAP_CONFIG.GetLevelData:InvokeServer()["id"])] then
  5453. decodedFile = game:GetService('HttpService'):JSONDecode(readfile(getgenv().levelMacros[tostring(workspace._MAP_CONFIG.GetLevelData:InvokeServer()["id"])]))
  5454. getgenv().macroUnitPositions = {}
  5455. instructionIncrement = 1
  5456.  
  5457. local function updateUnitPositions()
  5458. getgenv().macroUnitPositions = {}
  5459.  
  5460. for i, v in ipairs(game.Workspace["_UNITS"]:GetChildren()) do
  5461. if v:FindFirstChild("_stats") then
  5462. if tostring(v["_stats"].player.Value) == game.Players.LocalPlayer.Name and v["_stats"].xp.Value >= 0 and v["_stats"].id.Value ~= "metal_knight_drone" and v["_stats"].id.Value ~= "metal_knight_drone:shiny" and v["_stats"].id.Value ~= "aot_generic" then
  5463. table.insert(getgenv().macroUnitPositions, {v, v._hitbox.CFrame.X, v._hitbox.CFrame.Z})
  5464. end
  5465. end
  5466. end
  5467. end
  5468.  
  5469. local function getEquippedUnits()
  5470. equippedUnits = {}
  5471. local reg = getreg() --> returns Roblox's registry in a table
  5472.  
  5473. for i,v in next, reg do
  5474. if type(v) == 'function' then --> Checks if the current iteration is a function
  5475. if getfenv(v).script then --> Checks if the function's environment is in a script
  5476. for _, v in pairs(debug.getupvalues(v)) do --> Basically a for loop that prints everything, but in one line
  5477. if type(v) == 'table' then
  5478. if v["session"] then
  5479. for sus, bak in pairs(v["session"]["profile_data"]['collection']['equipped_units']) do
  5480. table.insert(equippedUnits, {bak, v["session"]["profile_data"]['collection']['owned_units'][bak]['unit_id']})
  5481. end
  5482. return equippedUnits
  5483. end
  5484. end
  5485. end
  5486. end
  5487. end
  5488. end
  5489. end
  5490.  
  5491. local function getCoordArgs(position)
  5492. coordArgs = {}
  5493. for coordArg in string.gmatch(position, "([^ ,]+)") do
  5494. table.insert(coordArgs, tonumber(coordArg))
  5495. --print(coordArg)
  5496. end
  5497. return coordArgs
  5498. end
  5499.  
  5500. repeat
  5501. task.wait(0.5)
  5502.  
  5503. if decodedFile[tostring(instructionIncrement)]['type'] == 'spawn_unit' then
  5504. repeat task.wait() until game.Players.LocalPlayer._stats.resource.Value >= decodedFile[tostring(instructionIncrement)]['money']
  5505. updateUnitPositions()
  5506. for _, unitInfo in pairs(getEquippedUnits()) do
  5507. if unitInfo[2] == decodedFile[tostring(instructionIncrement)]['unit'] then
  5508. if unitInfo[2] == "metal_knight_evolved" or unitInfo[2] == "metal_knight_evolved:shiny" then
  5509. task.spawn(function()
  5510. game:GetService("ReplicatedStorage").endpoints.client_to_server.spawn_unit:InvokeServer(unitInfo[1], CFrame.new(unpack(getCoordArgs(decodedFile[tostring(instructionIncrement)]['cframe']))))
  5511. instructionIncrement += 1
  5512. task.wait(2)
  5513. end)
  5514. else
  5515. game:GetService("ReplicatedStorage").endpoints.client_to_server.spawn_unit:InvokeServer(unitInfo[1], CFrame.new(unpack(getCoordArgs(decodedFile[tostring(instructionIncrement)]['cframe']))))
  5516. instructionIncrement += 1
  5517. end
  5518. end
  5519. end
  5520. end
  5521.  
  5522. if decodedFile[tostring(instructionIncrement)]['type'] == 'upgrade_unit_ingame' then
  5523. repeat task.wait() until game.Players.LocalPlayer._stats.resource.Value >= decodedFile[tostring(instructionIncrement)]['money']
  5524. updateUnitPositions()
  5525.  
  5526. print(game.Players.LocalPlayer._stats.resource.Value)
  5527. print(decodedFile[tostring(instructionIncrement)]['money'])
  5528. for _, unitPosition in pairs(getgenv().macroUnitPositions) do
  5529. if getCoordArgs(decodedFile[tostring(instructionIncrement)]['pos'])[1] == unitPosition[2] and getCoordArgs(decodedFile[tostring(instructionIncrement)]['pos'])[3] == unitPosition[3] then
  5530. game:GetService("ReplicatedStorage").endpoints.client_to_server.upgrade_unit_ingame:InvokeServer(unitPosition[1], unpack(getCoordArgs(decodedFile[tostring(instructionIncrement)]['pos'])))
  5531. end
  5532. end
  5533. instructionIncrement += 1
  5534. end
  5535.  
  5536. if decodedFile[tostring(instructionIncrement)]['type'] == 'sell_unit_ingame' then
  5537. repeat task.wait() until game.Players.LocalPlayer._stats.resource.Value >= decodedFile[tostring(instructionIncrement)]['money']
  5538.  
  5539. for _, unitPosition in pairs(getgenv().macroUnitPositions) do
  5540. if getCoordArgs(decodedFile[tostring(instructionIncrement)]['pos'][1]) == unitPosition[2] and getCoordArgs(decodedFile[tostring(instructionIncrement)]['pos'][3]) == unitPosition[3] then
  5541. game:GetService("ReplicatedStorage").endpoints.client_to_server.sell_unit_ingame:InvokeServer(unitPosition[1], unpack(getCoordArgs(decodedFile[tostring(instructionIncrement)]['pos'])))
  5542. end
  5543. end
  5544. instructionIncrement += 1
  5545. end
  5546. until decodedFile[tostring(instructionIncrement)] == nil
  5547. end
  5548. end))
  5549. end
  5550.  
  5551. if getgenv().recordingMacro then
  5552. getgenv().lockAutoFunctions = true
  5553. updatejson()
  5554. writeMacroToFile(tostring(workspace._MAP_CONFIG.GetLevelData:InvokeServer()["id"]).."-"..tostring(os.date('%Y%m%d-%H%M%S')).."-"..game.Players.LocalPlayer.Name..".json")
  5555. RayfieldLib:Notify({
  5556. Title = "Recording macro to file: " .. tostring(workspace._MAP_CONFIG.GetLevelData:InvokeServer()["id"]).."-"..tostring(os.date('%Y-%m-%d-%H:%M:%S'))..".json",
  5557. Content = "Starting Recording",
  5558. Duration = 6.5
  5559. })
  5560. autoMacroTab:CreateLabel("Recording Macro to file: " .. tostring(workspace._MAP_CONFIG.GetLevelData:InvokeServer()["map"]).."-"..tostring(os.date('%Y-%m-%d %H:%M:%S'))..".json")
  5561. end
  5562.  
  5563. game.Players.LocalPlayer.PlayerGui.MessageGui.Enabled = false
  5564. game:GetService("ReplicatedStorage").packages.assets["ui_sfx"].error.Volume = 0
  5565. game:GetService("ReplicatedStorage").packages.assets["ui_sfx"].error_old.Volume = 0
  5566.  
  5567. local autoLoadSection = autoFarmTab:CreateSection("Auto Load Script")
  5568. autoFarmTab:CreateLabel("This automatically executes script when you teleport to the main area.")
  5569. autoFarmTab:CreateLabel("You don't need to put the script in your autoexec folder!")
  5570. autoFarmTab:CreateToggle({
  5571. Name = "Auto Load Script",
  5572. CurrentValue = getgenv().AutoLoadTP,
  5573. Callback = function(bool)
  5574. getgenv().AutoLoadTP = bool
  5575. updatejson()
  5576. if exec == "Synapse X" and getgenv().AutoLoadTP then
  5577. syn.queue_on_teleport("loadstring(game:HttpGet('https://raw.githubusercontent.com/Tesseract1234567890/animeadv/main/script.lua'))()")
  5578. if exec == "Synapse X" then
  5579. syn.queue_on_teleport("loadstring(game:HttpGet('https://raw.githubusercontent.com/Tesseract1234567890/animeadv/main/script.lua'))()")
  5580. RayfieldLib:Notify({
  5581. Title = "Queued to Auto-Attach on Teleport!",
  5582. Content = "Success",
  5583. Duration = 6.5
  5584. })
  5585. end
  5586.  
  5587. elseif exec ~= "Synapse X" and getgenv().AutoLoadTP then
  5588. queue_on_teleport("loadstring(game:HttpGet('https://raw.githubusercontent.com/Tesseract1234567890/animeadv/main/script.lua'))()")
  5589. end
  5590. end})
  5591.  
  5592. autoFarmTab:CreateLabel("If it doesn't work properly, then put the script in the autoexec folder!")
  5593.  
  5594. local autoFarmSection = autoFarmTab:CreateSection("Auto Farm")
  5595.  
  5596. --#region Auto Farm Tab
  5597. autoFarmTab:CreateToggle({
  5598. Name = "Auto Continue",
  5599. CurrentValue = getgenv().AutoContinue,
  5600. Callback = function(bool)
  5601. getgenv().AutoContinue = bool
  5602. updatejson()
  5603. end})
  5604.  
  5605. autoFarmTab:CreateToggle({
  5606. Name = "Auto Replay",
  5607. CurrentValue = getgenv().AutoReplay,
  5608. Callback = function(bool)
  5609. getgenv().AutoReplay = bool
  5610. updatejson()
  5611. end})
  5612.  
  5613. autoFarmTab:CreateToggle({
  5614. Name = "Auto Leave",
  5615. CurrentValue = getgenv().AutoLeave,
  5616. Callback = function(bool)
  5617. getgenv().AutoLeave = bool
  5618. updatejson()
  5619. end})
  5620.  
  5621. autoFarmTab:CreateToggle({
  5622. Name = "Auto Farm Event",
  5623. CurrentValue = getgenv().AutoFarmTP,
  5624. Callback = function(bool)
  5625. getgenv().AutoFarmTP = bool
  5626. updatejson()
  5627. end})
  5628.  
  5629. autoFarmTab:CreateToggle({
  5630. Name = "Auto Start Infinity Castle",
  5631. CurrentValue = getgenv().AutoFarmIC,
  5632. Callback = function(bool)
  5633. getgenv().AutoFarmIC = bool
  5634. updatejson()
  5635. end})
  5636.  
  5637. autoFarmTab:CreateToggle({
  5638. Name = "Auto Farm",
  5639. CurrentValue = getgenv().AutoFarm,
  5640. Callback = function(bool)
  5641. getgenv().AutoFarm = bool
  5642. updatejson()
  5643. end})
  5644.  
  5645. autoFarmTab:CreateToggle({
  5646. Name = "Auto Start",
  5647. CurrentValue = getgenv().autoStart,
  5648. Callback = function(bool)
  5649. getgenv().autoStart = bool
  5650. updatejson()
  5651. end})
  5652.  
  5653. autoFarmTab:CreateToggle({
  5654. Name = "Auto Abilities",
  5655. CurrentValue = getgenv().autoabilities,
  5656. Callback = function(bool)
  5657. getgenv().autoabilities = bool
  5658. updatejson()
  5659. end})
  5660.  
  5661. autoFarmTab:CreateToggle({
  5662. Name = "Auto Upgrade Units",
  5663. CurrentValue = getgenv().autoUpgrade,
  5664. Callback = function(bool)
  5665. getgenv().autoUpgrade = bool
  5666. updatejson()
  5667. end})
  5668.  
  5669. local placementSection = autoFarmTab:CreateSection("Set Unit Placements")
  5670. --// Set Position \\--
  5671. autoFarmTab:CreateButton({
  5672. Name = "Set Unit 1 Postion",
  5673. Callback = function()
  5674. RayfieldLib:Notify({
  5675. Title = "Set Unit 1 Spawn Position",
  5676. Content = "Click on the floor to set the spawn unit position!\n (don't press \"Done\" until you set position)",
  5677. Duration = 99999999,
  5678. Actions = { -- Notification Buttons
  5679. Ignore = {
  5680. Name = "Done",
  5681. Callback = function()
  5682. print("The user tapped Okay!")
  5683. end
  5684. }
  5685. }
  5686. })
  5687. MouseClick("UP1")
  5688. end})
  5689.  
  5690. autoFarmTab:CreateButton({
  5691. Name = "Set Unit 2 Postion",
  5692. Callback = function()
  5693. RayfieldLib:Notify({
  5694. Title = "Set Unit 2 Spawn Position",
  5695. Content = "Click on the floor to set the spawn unit position!\n (don't press \"Done\" until you set position)",
  5696. Duration = 99999999,
  5697. Actions = { -- Notification Buttons
  5698. Ignore = {
  5699. Name = "Done",
  5700. Callback = function()
  5701. print("The user tapped Okay!")
  5702. end
  5703. }
  5704. }
  5705. })
  5706. MouseClick("UP2")
  5707. end})
  5708.  
  5709. autoFarmTab:CreateButton({
  5710. Name = "Set Unit 3 Postion",
  5711. Callback = function()
  5712. RayfieldLib:Notify({
  5713. Title = "Set Unit 3 Spawn Position",
  5714. Content = "Click on the floor to set the spawn unit position!\n (don't press \"Done\" until you set position)",
  5715. Duration = 99999999,
  5716. Actions = { -- Notification Buttons
  5717. Ignore = {
  5718. Name = "Done",
  5719. Callback = function()
  5720. print("The user tapped Okay!")
  5721. end
  5722. }
  5723. }
  5724. })
  5725. MouseClick("UP3")
  5726. end})
  5727.  
  5728. autoFarmTab:CreateButton({
  5729. Name = "Set Unit 4 Postion",
  5730. Callback = function()
  5731. RayfieldLib:Notify({
  5732. Title = "Set Unit 4 Spawn Position",
  5733. Content = "Click on the floor to set the spawn unit position!\n (don't press \"Done\" until you set position)",
  5734. Duration = 99999999,
  5735. Actions = { -- Notification Buttons
  5736. Ignore = {
  5737. Name = "Done",
  5738. Callback = function()
  5739. print("The user tapped Okay!")
  5740. end
  5741. }
  5742. }
  5743. })
  5744. MouseClick("UP4")
  5745. end})
  5746.  
  5747.  
  5748. local axxc = game.Players.LocalPlayer.PlayerGui["spawn_units"].Lives.Main.Desc.Level.Text:split(" ")
  5749.  
  5750. if tonumber(axxc[2]) >= 20 then
  5751. autoFarmTab:CreateButton({
  5752. Name = "Set Unit 5 Postion",
  5753. Callback = function()
  5754. RayfieldLib:Notify({
  5755. Title = "Set Unit 5 Spawn Position",
  5756. Content = "Click on the floor to set the spawn unit position!\n (don't press \"Done\" until you set position)",
  5757. Duration = 99999999,
  5758. Actions = { -- Notification Buttons
  5759. Ignore = {
  5760. Name = "Done",
  5761. Callback = function()
  5762. print("The user tapped Okay!")
  5763. end
  5764. }
  5765. }
  5766. })
  5767. MouseClick("UP5")
  5768. end})
  5769. end
  5770.  
  5771. if tonumber(axxc[2]) >= 50 then
  5772. autoFarmTab:CreateButton({
  5773. Name = "Set Unit 6 Postion",
  5774. Callback = function()
  5775. RayfieldLib:Notify({
  5776. Title = "Set Unit 6 Spawn Position",
  5777. Content = "Click on the floor to set the spawn unit position!\n (don't press \"Done\" until you set position)",
  5778. Duration = 99999999,
  5779. Actions = { -- Notification Buttons
  5780. Ignore = {
  5781. Name = "Done",
  5782. Callback = function()
  5783. print("The user tapped Okay!")
  5784. end
  5785. }
  5786. }
  5787. })
  5788. MouseClick("UP6")
  5789. end})
  5790. end
  5791.  
  5792. local autoSellSection = autoFarmTab:CreateSection("Auto Sell/Quit")
  5793.  
  5794. autoFarmTab:CreateToggle({
  5795. Name = "Auto Sell at Specific Wave",
  5796. CurrentValue = getgenv().autoSell,
  5797. Callback = function(bool)
  5798. getgenv().autoSell = bool
  5799. updatejson()
  5800. if getgenv().autoSell == false then
  5801. getgenv().disableAutoFarm = false
  5802. end
  5803. end})
  5804.  
  5805. autoFarmTab:CreateToggle({
  5806. Name = "Auto Quit at Specific Wave",
  5807. CurrentValue = getgenv().autoQuit,
  5808. Callback = function(bool)
  5809. getgenv().autoQuit = bool
  5810. updatejson()
  5811. end})
  5812.  
  5813. autoFarmTab:CreateInput({
  5814. Name = "Select Wave Number for Auto Sell {Press Enter}",
  5815. PlaceholderText = tostring(getgenv().sellatwave),
  5816. RemoveTextAfterFocusLost = false,
  5817. Callback = function(t)
  5818. getgenv().sellatwave = tonumber(t)
  5819. updatejson()
  5820. end})
  5821.  
  5822. autoFarmTab:CreateInput({
  5823. Name = "Select Wave Number for Auto Quit {Press Enter}",
  5824. PlaceholderText = tostring(getgenv().quitAtWave),
  5825. RemoveTextAfterFocusLost = false,
  5826. Callback = function(t)
  5827. getgenv().quitAtWave = tonumber(t)
  5828. updatejson()
  5829. end})
  5830.  
  5831. function MouseClick(UnitPos)
  5832. local connection
  5833. local _map = game:GetService("Workspace")["_BASES"].player.base["fake_unit"]:WaitForChild("HumanoidRootPart")
  5834. connection = UserInputService.InputBegan:Connect(
  5835. function(input, gameProcessed)
  5836. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  5837. connection:Disconnect()
  5838. local a = Instance.new("Part", game.Workspace)
  5839. a.Size = Vector3.new(1, 1, 1)
  5840. a.Material = Enum.Material.Neon
  5841. a.Position = mouse.hit.p
  5842. task.wait()
  5843. a.Anchored = true
  5844. RayfieldLib:Notify({
  5845. Title = "Spawn Unit Position:",
  5846. Content = tostring(a.Position),
  5847. Duration = 6.5,
  5848. Actions = { -- Notification Buttons
  5849. Ignore = {
  5850. Name = "Okay!",
  5851. Callback = function()
  5852. print("The user tapped Okay!")
  5853. end
  5854. }
  5855. }
  5856. })
  5857. a.CanCollide = false
  5858. for i = 0, 1, 0.1 do
  5859. a.Transparency = i
  5860. task.wait()
  5861. end
  5862. a:Destroy()
  5863.  
  5864. if game.Workspace._map:FindFirstChild("namek mushroom model") then
  5865. print("Namak")
  5866. SpawnUnitPos["Namak"][UnitPos]["x"] = a.Position.X
  5867. SpawnUnitPos["Namak"][UnitPos]["y"] = a.Position.Y
  5868. SpawnUnitPos["Namak"][UnitPos]["z"] = a.Position.Z
  5869. elseif game.Workspace._map:FindFirstChild("houses_new") then
  5870. print("Aot")
  5871. SpawnUnitPos["Aot"][UnitPos]["x"] = a.Position.X
  5872. SpawnUnitPos["Aot"][UnitPos]["y"] = a.Position.Y
  5873. SpawnUnitPos["Aot"][UnitPos]["z"] = a.Position.Z
  5874. elseif game.Workspace._map:FindFirstChild("Snow Particles") then
  5875. print("Snowy")
  5876. SpawnUnitPos["Snowy"][UnitPos]["x"] = a.Position.X
  5877. SpawnUnitPos["Snowy"][UnitPos]["y"] = a.Position.Y
  5878. SpawnUnitPos["Snowy"][UnitPos]["z"] = a.Position.Z
  5879. elseif game.Workspace._map:FindFirstChild("sand_gate") then
  5880. warn("Sand")
  5881. SpawnUnitPos["Sand"][UnitPos]["x"] = a.Position.X
  5882. SpawnUnitPos["Sand"][UnitPos]["y"] = a.Position.Y
  5883. SpawnUnitPos["Sand"][UnitPos]["z"] = a.Position.Z
  5884. elseif game.Workspace._map:FindFirstChild("icebergs") then
  5885. print("Marine")
  5886. SpawnUnitPos["Marine"][UnitPos]["x"] = a.Position.X
  5887. SpawnUnitPos["Marine"][UnitPos]["y"] = a.Position.Y
  5888. SpawnUnitPos["Marine"][UnitPos]["z"] = a.Position.Z
  5889. elseif game.Workspace._map:FindFirstChild("Helicopter Pad") then
  5890. print("Ghoul")
  5891. SpawnUnitPos["Ghoul"][UnitPos]["x"] = a.Position.X
  5892. SpawnUnitPos["Ghoul"][UnitPos]["y"] = a.Position.Y
  5893. SpawnUnitPos["Ghoul"][UnitPos]["z"] = a.Position.Z
  5894. elseif game.Workspace._map:FindFirstChild("Bones/dust") then
  5895. print("Hollow")
  5896. SpawnUnitPos["Hollow"][UnitPos]["x"] = a.Position.X
  5897. SpawnUnitPos["Hollow"][UnitPos]["y"] = a.Position.Y
  5898. SpawnUnitPos["Hollow"][UnitPos]["z"] = a.Position.Z
  5899. elseif game.Workspace._map:FindFirstChild("Ant Nest") then
  5900. print("Ant")
  5901. SpawnUnitPos["Ant"][UnitPos]["x"] = a.Position.X
  5902. SpawnUnitPos["Ant"][UnitPos]["y"] = a.Position.Y
  5903. SpawnUnitPos["Ant"][UnitPos]["z"] = a.Position.Z
  5904. elseif game.Workspace._map:FindFirstChild("light poles") then
  5905. print("Magic")
  5906. SpawnUnitPos["Magic"][UnitPos]["x"] = a.Position.X
  5907. SpawnUnitPos["Magic"][UnitPos]["y"] = a.Position.Y
  5908. SpawnUnitPos["Magic"][UnitPos]["z"] = a.Position.Z
  5909. elseif game.Workspace._map:FindFirstChild("LanternsGround") then
  5910. print("Cursed")
  5911. SpawnUnitPos["Cursed"][UnitPos]["x"] = a.Position.X
  5912. SpawnUnitPos["Cursed"][UnitPos]["y"] = a.Position.Y
  5913. SpawnUnitPos["Cursed"][UnitPos]["z"] = a.Position.Z
  5914. elseif game.Workspace._map:FindFirstChild("pumpkins") then
  5915. print("thriller_park")
  5916. SpawnUnitPos["thriller_park"][UnitPos]["x"] = a.Position.X
  5917. SpawnUnitPos["thriller_park"][UnitPos]["y"] = a.Position.Y
  5918. SpawnUnitPos["thriller_park"][UnitPos]["z"] = a.Position.Z
  5919. elseif game.Workspace._map:FindFirstChild("skeleton") then
  5920. print("black_clover")
  5921. SpawnUnitPos["black_clover"][UnitPos]["x"] = a.Position.X
  5922. SpawnUnitPos["black_clover"][UnitPos]["y"] = a.Position.Y
  5923. SpawnUnitPos["black_clover"][UnitPos]["z"] = a.Position.Z
  5924. elseif game.Workspace._map:FindFirstChild("graves") then
  5925. print("hollow_leg")
  5926. SpawnUnitPos["hollow_leg"][UnitPos]["x"] = a.Position.X
  5927. SpawnUnitPos["hollow_leg"][UnitPos]["y"] = a.Position.Y
  5928. SpawnUnitPos["hollow_leg"][UnitPos]["z"] = a.Position.Z
  5929. elseif game.Workspace._map:FindFirstChild("SpaceCenter") then
  5930. print("Cape Canaveral")
  5931. SpawnUnitPos["jojo"][UnitPos]["x"] = a.Position.X
  5932. SpawnUnitPos["jojo"][UnitPos]["y"] = a.Position.Y
  5933. SpawnUnitPos["jojo"][UnitPos]["z"] = a.Position.Z
  5934. elseif game.Workspace._map:FindFirstChild("Big_Stairs") then
  5935. print("Chainsaw Man")
  5936. SpawnUnitPos["csm_event"][UnitPos]["x"] = a.Position.X
  5937. SpawnUnitPos["csm_event"][UnitPos]["y"] = a.Position.Y
  5938. SpawnUnitPos["csm_event"][UnitPos]["z"] = a.Position.Z
  5939. elseif game.Workspace._map:FindFirstChild("Capybara") then
  5940. print("One Punch Man")
  5941. SpawnUnitPos["opm"][UnitPos]["x"] = a.Position.X
  5942. SpawnUnitPos["opm"][UnitPos]["y"] = a.Position.Y
  5943. SpawnUnitPos["opm"][UnitPos]["z"] = a.Position.Z
  5944. end
  5945. updatejson()
  5946. end
  5947. end)
  5948. end
  5949.  
  5950.  
  5951. -- set unit position end--
  5952.  
  5953. --#endregion
  5954.  
  5955. --#region Auto Challenge
  5956.  
  5957. local autoChallengeSection = autoFarmTab:CreateSection("Auto Challenge")
  5958.  
  5959. autoFarmTab:CreateToggle({
  5960. Name = "Auto Challenge",
  5961. CurrentValue = getgenv().AutoChallenge,
  5962. Callback = function(bool)
  5963. getgenv().AutoChallenge = bool
  5964. updatejson()
  5965. end})
  5966.  
  5967. local worlddrop = autoFarmTab:CreateDropdown({
  5968. Name = "Select Reward",
  5969. Options = {"star_fruit_random","star_remnant","gems", "gold"},
  5970. CurrentOption = getgenv().selectedreward,
  5971. Callback = function(reward)
  5972. getgenv().selectedreward = reward
  5973. updatejson()
  5974. end})
  5975.  
  5976. autoFarmTab:CreateToggle({
  5977. Name = "Farm All Rewards",
  5978. CurrentValue = getgenv().AutoChallengeAll,
  5979. Callback = function(bool)
  5980. getgenv().AutoChallengeAll = bool
  5981. updatejson()
  5982. end})
  5983.  
  5984. --#region Webhook
  5985. --//Webhook Tab (in-game)\\--
  5986. local webhookSection = webhookTab:CreateSection("Webhooks")
  5987. webhookTab:CreateLabel("Webhooks send notifications in Discord everytime a game is finished!")
  5988.  
  5989. local webhookPlaceholder
  5990. if getgenv().webUrl == "" then
  5991. webhookPlaceholder = "Insert URL here!"
  5992. else
  5993. webhookPlaceholder = "Good to go!"
  5994. end
  5995. webhookTab:CreateInput({
  5996. Name = "Webhook URL {Press Enter}" ,
  5997. PlaceholderText = webhookPlaceholder,
  5998. RemoveTextAfterFocusLost = false,
  5999. Callback = function(web_url)
  6000. getgenv().webUrl = web_url
  6001. updatejson()
  6002. end})
  6003.  
  6004. local sniperWebhookPlaceholder
  6005. if getgenv().sniperUrl == "" then
  6006. sniperWebhookPlaceholder = "Insert URL here!"
  6007. else
  6008. sniperWebhookPlaceholder = "Good to go!"
  6009. end
  6010.  
  6011. webhookTab:CreateInput({
  6012. Name = "Sniper Webhook URL {Press Enter}" ,
  6013. PlaceholderText = sniperWebhookPlaceholder,
  6014. RemoveTextAfterFocusLost = false,
  6015. Callback = function(sniper_url)
  6016. getgenv().sniperUrl = sniper_url
  6017. updatejson()
  6018. end})
  6019.  
  6020. webhookTab:CreateButton({
  6021. Name = "Test Regular Webhooks",
  6022. Callback = function()
  6023. Webhook()
  6024. BabyWebhook()
  6025. NormalItemWebhook(true)
  6026. UniqueItemWebhook(true)
  6027. end})
  6028.  
  6029. webhookTab:CreateButton({
  6030. Name = "Test Sniper Webhooks",
  6031. Callback = function()
  6032. ShopSniperWebhook(true)
  6033. SpecialSummonSniperWebhook(true)
  6034. StandardSummonSniperWebhook(true)
  6035. end})
  6036. --#endregion
  6037.  
  6038.  
  6039. end
  6040.  
  6041. --#endregion
  6042.  
  6043. local creditsTab = mainWindow:CreateTab("Credits")
  6044. local credits = creditsTab:CreateSection("Credits")
  6045. creditsTab:CreateLabel("Arpon AG#6612")
  6046. creditsTab:CreateLabel("Forever4D#0001")
  6047. creditsTab:CreateLabel("Defrag")
  6048. end
  6049.  
  6050. --------------------------------------------------
  6051. --------------------------------------------------
  6052.  
  6053. ---// Checks if file exist or not\\---
  6054. if isfile(saveFileName) then
  6055.  
  6056. local jsonData = readfile(saveFileName)
  6057. local data = HttpService:JSONDecode(jsonData)
  6058.  
  6059. MainModule()
  6060.  
  6061. else
  6062. --#region CREATES JSON
  6063. local xdata = {
  6064. altcount = 3,
  6065. lowcpumode = false,
  6066. AutoReplay = false,
  6067. AutoLeave = false,
  6068. AutoChallenge = false,
  6069. autoportal = false,
  6070. autoportalcsm = false,
  6071. selectedreward = "star_fruit_random",
  6072. AutoChallengeAll = false,
  6073. autoabilities = false,
  6074. lockautofunctions = false,
  6075. autofarmtp = false,
  6076. webhook = "",
  6077. sniperwebhook = "",
  6078. sellatwave = 0,
  6079. quitAtWave = 0,
  6080. autoSell = false,
  6081. autofarm = false,
  6082. autofarmic = false,
  6083. autoStart = false,
  6084. autoloadtp = true,
  6085. autoUpgrade = false,
  6086. autocontinue = false,
  6087. difficulty = "nil",
  6088. world = "nil",
  6089. macroworld = "nil",
  6090. level = "nil",
  6091. macrolevel = "nil",
  6092. raidlevel = 'nil',
  6093. levelmacros = {},
  6094. door = "nil",
  6095. currentmerchantitems = {},
  6096. currentspecialbannerunits = {},
  6097. currentstandardbannerunits = {},
  6098. recordingmacro = false,
  6099. recordmacroonteleport = false,
  6100. replaymacroonteleport = false,
  6101. macrotoreplay = "",
  6102. altlist = {},
  6103. mainaccount = "nil",
  6104. altmode = false,
  6105. unitplacementsettings = {
  6106. U1 = {
  6107. placementPriority = 0,
  6108. upgradePriority = 0,
  6109. placeFromWave = 0,
  6110. upgradeFromWave = 0,
  6111. upgradeCap = 999
  6112. },
  6113. U2 = {
  6114. placementPriority = 0,
  6115. upgradePriority = 0,
  6116. placeFromWave = 0,
  6117. upgradeFromWave = 0,
  6118. upgradeCap = 999
  6119. },
  6120. U3 = {
  6121. placementPriority = 0,
  6122. upgradePriority = 0,
  6123. placeFromWave = 0,
  6124. upgradeFromWave = 0,
  6125. upgradeCap = 999
  6126. },
  6127. U4 = {
  6128. placementPriority = 0,
  6129. upgradePriority = 0,
  6130. placeFromWave = 0,
  6131. upgradeFromWave = 0,
  6132. upgradeCap = 999
  6133. },
  6134. U5 = {
  6135. placementPriority = 0,
  6136. upgradePriority = 0,
  6137. placeFromWave = 0,
  6138. upgradeFromWave = 0,
  6139. upgradeCap = 999
  6140. },
  6141. U6 = {
  6142. placementPriority = 0,
  6143. upgradePriority = 0,
  6144. placeFromWave = 0,
  6145. upgradeFromWave = 0,
  6146. upgradeCap = 999
  6147. }
  6148. },
  6149.  
  6150. xspawnUnitPos = {
  6151. uchiha = {
  6152. UP1 = {
  6153. y = 1.4244641065597535,
  6154. x = -109.30056762695313,
  6155. z = -54.575347900390628
  6156. },
  6157. UP3 = {
  6158. y = 1.4322717189788819,
  6159. x = -114.2433853149414,
  6160. z = -55.260982513427737
  6161. },
  6162. UP2 = {
  6163. y = 1.7082736492156983,
  6164. x = -127.53932189941406,
  6165. z = -55.277626037597659
  6166. },
  6167. UP6 = {
  6168. y = 1.4487617015838624,
  6169. x = -107.07078552246094,
  6170. z = -51.333045959472659
  6171. },
  6172. UP5 = {
  6173. y = 1.8965977430343629,
  6174. x = -118.5692138671875,
  6175. z = -57.20484161376953
  6176. },
  6177. UP4 = {
  6178. y = 1.4205386638641358,
  6179. x = -105.46223449707031,
  6180. z = -51.20615005493164
  6181. }
  6182. },
  6183. opm = {
  6184. UP1 = {
  6185. y = 1.4244641065597535,
  6186. x = -109.30056762695313,
  6187. z = -54.575347900390628
  6188. },
  6189. UP3 = {
  6190. y = 1.4322717189788819,
  6191. x = -114.2433853149414,
  6192. z = -55.260982513427737
  6193. },
  6194. UP2 = {
  6195. y = 1.7082736492156983,
  6196. x = -127.53932189941406,
  6197. z = -55.277626037597659
  6198. },
  6199. UP6 = {
  6200. y = 1.4487617015838624,
  6201. x = -107.07078552246094,
  6202. z = -51.333045959472659
  6203. },
  6204. UP5 = {
  6205. y = 1.8965977430343629,
  6206. x = -118.5692138671875,
  6207. z = -57.20484161376953
  6208. },
  6209. UP4 = {
  6210. y = 1.4205386638641358,
  6211. x = -105.46223449707031,
  6212. z = -51.20615005493164
  6213. }
  6214. },
  6215. csm_event = {
  6216. UP1 = {
  6217. y = 1.4244641065597535,
  6218. x = -109.30056762695313,
  6219. z = -54.575347900390628
  6220. },
  6221. UP3 = {
  6222. y = 1.4322717189788819,
  6223. x = -114.2433853149414,
  6224. z = -55.260982513427737
  6225. },
  6226. UP2 = {
  6227. y = 1.7082736492156983,
  6228. x = -127.53932189941406,
  6229. z = -55.277626037597659
  6230. },
  6231. UP6 = {
  6232. y = 1.4487617015838624,
  6233. x = -107.07078552246094,
  6234. z = -51.333045959472659
  6235. },
  6236. UP5 = {
  6237. y = 1.8965977430343629,
  6238. x = -118.5692138671875,
  6239. z = -57.20484161376953
  6240. },
  6241. UP4 = {
  6242. y = 1.4205386638641358,
  6243. x = -105.46223449707031,
  6244. z = -51.20615005493164
  6245. }
  6246. },
  6247. black_clover = {
  6248. UP1 = {
  6249. y = 1.4244641065597535,
  6250. x = -109.30056762695313,
  6251. z = -54.575347900390628
  6252. },
  6253. UP3 = {
  6254. y = 1.4322717189788819,
  6255. x = -114.2433853149414,
  6256. z = -55.260982513427737
  6257. },
  6258. UP2 = {
  6259. y = 1.7082736492156983,
  6260. x = -127.53932189941406,
  6261. z = -55.277626037597659
  6262. },
  6263. UP6 = {
  6264. y = 1.4487617015838624,
  6265. x = -107.07078552246094,
  6266. z = -51.333045959472659
  6267. },
  6268. UP5 = {
  6269. y = 1.8965977430343629,
  6270. x = -118.5692138671875,
  6271. z = -57.20484161376953
  6272. },
  6273. UP4 = {
  6274. y = 1.4205386638641358,
  6275. x = -105.46223449707031,
  6276. z = -51.20615005493164
  6277. }
  6278. },
  6279. hollow_leg = {
  6280. UP1 = {
  6281. x = -168.71795654296875,
  6282. y = 36.04443359375,
  6283. z = 564.4705810546875
  6284. },
  6285. UP2 = {
  6286. x = -161.105712890625,
  6287. y = 36.04443359375,
  6288. z = 558.4195556640625
  6289. },
  6290. UP3 = {
  6291. x = -161.05670166015625,
  6292. y = 36.04443359375,
  6293. z = 546.204833984375
  6294.  
  6295. },
  6296. UP4 = {
  6297. x = -163.51824951171875,
  6298. y = 36.04443359375,
  6299. z = 534.6953735351562
  6300. },
  6301. UP5 = {
  6302. x = -170.02479553222656,
  6303. y = 36.04443359375,
  6304. z = 528.9660034179688
  6305. },
  6306. UP6 = {
  6307. x = -160.92405700683594,
  6308. y = 36.04443359375,
  6309. z = 565.2430419921875
  6310. }
  6311. },
  6312. Cursed = {
  6313. UP1 = {
  6314. y = 122.78201293945313,
  6315. x = 361.69732666015627,
  6316. z = -89.76468658447266
  6317. },
  6318. UP3 = {
  6319. y = 122.73872375488281,
  6320. x = 372.2068786621094,
  6321. z = -62.877601623535159
  6322. },
  6323. UP2 = {
  6324. y = 122.73872375488281,
  6325. x = 391.6465759277344,
  6326. z = -62.87253189086914
  6327. },
  6328. UP6 = {
  6329. y = 121.5274887084961,
  6330. x = 399.4963684082031,
  6331. z = -60.31044387817383
  6332. },
  6333. UP5 = {
  6334. y = 121.6282958984375,
  6335. x = 400.8389587402344,
  6336. z = -64.46269226074219
  6337. },
  6338. UP4 = {
  6339. y = 122.73872375488281,
  6340. x = 362.14788818359377,
  6341. z = -77.3993148803711
  6342. }
  6343. },
  6344. Sand = {
  6345. UP1 = {
  6346. y = 25.514015197753908,
  6347. x = -919.7685546875,
  6348. z = 290.9293518066406
  6349. },
  6350. UP3 = {
  6351. y = 25.518001556396486,
  6352. x = -919.7103881835938,
  6353. z = 288.1217346191406
  6354. },
  6355. UP2 = {
  6356. y = 26.06340980529785,
  6357. x = -920.3797607421875,
  6358. z = 300.7817077636719
  6359. },
  6360. UP6 = {
  6361. y = 25.528093338012697,
  6362. x = -916.4822998046875,
  6363. z = 287.9609069824219
  6364. },
  6365. UP5 = {
  6366. y = 25.71731185913086,
  6367. x = -920.7069091796875,
  6368. z = 296.8504943847656
  6369. },
  6370. UP4 = {
  6371. y = 25.508501052856447,
  6372. x = -919.2952270507813,
  6373. z = 294.7797546386719
  6374. }
  6375. },
  6376. Namak = {
  6377. UP1 = {
  6378. y = 92.14557647705078,
  6379. x = -2931.182861328125,
  6380. z = -698.5640869140625
  6381. },
  6382. UP3 = {
  6383. y = 92.5256118774414,
  6384. x = -2950.3916015625,
  6385. z = -697.1671142578125
  6386. },
  6387. UP2 = {
  6388. y = 93.32953643798828,
  6389. x = -2940.813720703125,
  6390. z = -697.09326171875
  6391. },
  6392. UP6 = {
  6393. y = 92.16944885253906,
  6394. x = -2946.967041015625,
  6395. z = -710.122802734375
  6396. },
  6397. UP5 = {
  6398. y = 92.15478515625,
  6399. x = -2947.684326171875,
  6400. z = -699.6248779296875
  6401. },
  6402. UP4 = {
  6403. y = 92.5256118774414,
  6404. x = -2950.408935546875,
  6405. z = -709.8072509765625
  6406. }
  6407. },
  6408. Hollow = {
  6409. UP1 = {
  6410. y = 133.10752868652345,
  6411. x = -168.9812774658203,
  6412. z = -692.3645629882813
  6413. },
  6414. UP3 = {
  6415. y = 133.09632873535157,
  6416. x = -167.3197021484375,
  6417. z = -695.4755249023438
  6418. },
  6419. UP2 = {
  6420. y = 133.50978088378907,
  6421. x = -160.6356964111328,
  6422. z = -709.1862182617188
  6423. },
  6424. UP6 = {
  6425. y = 133.08169555664063,
  6426. x = -176.02857971191407,
  6427. z = -691.7825317382813
  6428. },
  6429. UP5 = {
  6430. y = 133.0151824951172,
  6431. x = -161.20188903808595,
  6432. z = -702.9484252929688
  6433. },
  6434. UP4 = {
  6435. y = 133.17193603515626,
  6436. x = -172.60714721679688,
  6437. z = -691.3147583007813
  6438. }
  6439. },
  6440. Ant = {
  6441. UP1 = {
  6442. y = 23.502197265625,
  6443. x = -180.23072814941407,
  6444. z = 2961.130126953125
  6445. },
  6446. UP3 = {
  6447. y = 23.855152130126954,
  6448. x = -167.0123748779297,
  6449. z = 2954.2958984375
  6450. },
  6451. UP2 = {
  6452. y = 23.637359619140626,
  6453. x = -205.69203186035157,
  6454. z = 2964.095947265625
  6455. },
  6456. UP6 = {
  6457. y = 23.31997299194336,
  6458. x = -163.1376953125,
  6459. z = 2959.968017578125
  6460. },
  6461. UP5 = {
  6462. y = 23.598222732543947,
  6463. x = -170.1063232421875,
  6464. z = 2955.477294921875
  6465. },
  6466. UP4 = {
  6467. y = 23.855152130126954,
  6468. x = -156.4979705810547,
  6469. z = 2959.6123046875
  6470. }
  6471. },
  6472. Aot = {
  6473. UP1 = {
  6474. y = 34.25483703613281,
  6475. x = -3016.723388671875,
  6476. z = -682.4714965820313
  6477. },
  6478. UP3 = {
  6479. y = 34.442054748535159,
  6480. x = -3024.1181640625,
  6481. z = -682.2401123046875
  6482. },
  6483. UP2 = {
  6484. y = 34.387603759765628,
  6485. x = -3035.071533203125,
  6486. z = -683.9107055664063
  6487. },
  6488. UP6 = {
  6489. y = 34.25492477416992,
  6490. x = -3019.5390625,
  6491. z = -681.8257446289063
  6492. },
  6493. UP5 = {
  6494. y = 34.25492477416992,
  6495. x = -3030.930419921875,
  6496. z = -683.3449096679688
  6497. },
  6498. UP4 = {
  6499. y = 34.442054748535159,
  6500. x = -3013.065185546875,
  6501. z = -681.4302368164063
  6502. }
  6503. },
  6504. Snowy = {
  6505. UP1 = {
  6506. y = 34.8720588684082,
  6507. x = -2884.6103515625,
  6508. z = -139.17750549316407
  6509. },
  6510. UP3 = {
  6511. y = 35.055450439453128,
  6512. x = -2871.251708984375,
  6513. z = -131.86231994628907
  6514. },
  6515. UP2 = {
  6516. y = 34.86832046508789,
  6517. x = -2863.6240234375,
  6518. z = -120.90508270263672
  6519. },
  6520. UP6 = {
  6521. y = 34.79566192626953,
  6522. x = -2853.62548828125,
  6523. z = -123.30137634277344
  6524. },
  6525. UP5 = {
  6526. y = 34.79277038574219,
  6527. x = -2853.63232421875,
  6528. z = -119.10173034667969
  6529. },
  6530. UP4 = {
  6531. y = 34.86832046508789,
  6532. x = -2878.749755859375,
  6533. z = -138.48580932617188
  6534. }
  6535. },
  6536. Ghoul = {
  6537. UP1 = {
  6538. y = 59.36590576171875,
  6539. x = -3008.964111328125,
  6540. z = -56.00475311279297
  6541. },
  6542. UP3 = {
  6543. y = 59.03008270263672,
  6544. x = -3008.75732421875,
  6545. z = -58.37107849121094
  6546. },
  6547. UP2 = {
  6548. y = 59.382938385009769,
  6549. x = -2998.44140625,
  6550. z = -42.68498992919922
  6551. },
  6552. UP6 = {
  6553. y = 59.03008270263672,
  6554. x = -3009.03125,
  6555. z = -67.12299346923828
  6556. },
  6557. UP5 = {
  6558. y = 59.03008270263672,
  6559. x = -3007.1025390625,
  6560. z = -52.12919998168945
  6561. },
  6562. UP4 = {
  6563. y = 59.03008270263672,
  6564. x = -3008.94580078125,
  6565. z = -63.67665100097656
  6566. }
  6567. },
  6568. Magic = {
  6569. UP1 = {
  6570. y = 7.411101341247559,
  6571. x = -606.7291259765625,
  6572. z = -815.5218505859375
  6573. },
  6574. UP3 = {
  6575. y = 7.411093711853027,
  6576. x = -589.5305786132813,
  6577. z = -814.8512573242188
  6578. },
  6579. UP2 = {
  6580. y = 7.413991928100586,
  6581. x = -578.809814453125,
  6582. z = -814.5386962890625
  6583. },
  6584. UP6 = {
  6585. y = 7.372146129608154,
  6586. x = -605.3615112304688,
  6587. z = -820.8731079101563
  6588. },
  6589. UP5 = {
  6590. y = 7.413986682891846,
  6591. x = -597.8843383789063,
  6592. z = -814.5377807617188
  6593. },
  6594. UP4 = {
  6595. y = 7.4139862060546879,
  6596. x = -600.348388671875,
  6597. z = -814.8621215820313
  6598. }
  6599. },
  6600. Marine = {
  6601. UP1 = {
  6602. y = 25.521255493164064,
  6603. x = -2566.733642578125,
  6604. z = -62.77167892456055
  6605. },
  6606. UP3 = {
  6607. y = 25.5211124420166,
  6608. x = -2565.930419921875,
  6609. z = -57.89338684082031
  6610. },
  6611. UP2 = {
  6612. y = 25.210872650146486,
  6613. x = -2560.966796875,
  6614. z = -44.40180969238281
  6615. },
  6616. UP6 = {
  6617. y = 25.676485061645509,
  6618. x = -2566.796142578125,
  6619. z = -67.01408386230469
  6620. },
  6621. UP5 = {
  6622. y = 25.5211238861084,
  6623. x = -2563.39990234375,
  6624. z = -63.74509811401367
  6625. },
  6626. UP4 = {
  6627. y = 24.990556716918947,
  6628. x = -2570.3349609375,
  6629. z = -69.34259033203125
  6630. }
  6631. },
  6632. thriller_park = {
  6633. UP1 = {
  6634. y = 113.23728942871094,
  6635. x = -224.14295959472657,
  6636. z = -657.738037109375
  6637. },
  6638. UP3 = {
  6639. y = 109.37400817871094,
  6640. x = -224.78709411621095,
  6641. z = -640.7178955078125
  6642. },
  6643. UP2 = {
  6644. y = 109.37401580810547,
  6645. x = -229.42715454101563,
  6646. z = -649.636474609375
  6647. },
  6648. UP6 = {
  6649. y = 109.37400817871094,
  6650. x = -214.7626190185547,
  6651. z = -632.3900146484375
  6652. },
  6653. UP5 = {
  6654. y = 109.37401580810547,
  6655. x = -230.53053283691407,
  6656. z = -657.9769287109375
  6657. },
  6658. UP4 = {
  6659. y = 109.37400817871094,
  6660. x = -220.0915985107422,
  6661. z = -636.2127075195313
  6662. }
  6663. },
  6664. jojo = {
  6665. UP1 = {
  6666. x = -111.61297607421875,
  6667. y = 15.255210876464844,
  6668. z = -513.5579833984375
  6669. },
  6670. UP3 = {
  6671. x = -120.01858520507812,
  6672. y = 15.255210876464844,
  6673. z = -522.66650390625
  6674. },
  6675. UP2 = {
  6676. x = -124.42668151855469,
  6677. y = 15.255210876464844,
  6678. z = -530.7169799804688
  6679. },
  6680. UP6 = {
  6681. x = -120.38040161132812,
  6682. y = 15.255212783813477,
  6683. z = -536.6077270507812
  6684. },
  6685. UP5 = {
  6686. x = -115.62987518310547,
  6687. y = 15.255210876464844,
  6688. z = -518.679931640625
  6689. },
  6690. UP4 = {
  6691. x = -118.3056411743164,
  6692. y = 15.255210876464844,
  6693. z = -529.9589233398438
  6694. }
  6695. }
  6696.  
  6697. },
  6698.  
  6699. xselectedUnits = {
  6700. U1 = "nil #nil",
  6701. U2 = "nil #nil",
  6702. U3 = "nil #nil",
  6703. U4 = "nil #nil",
  6704. U5 = "nil #nil",
  6705. U6 = "nil #nil"
  6706. },
  6707. raidworld = "nil"
  6708.  
  6709. }
  6710.  
  6711. local json = HttpService:JSONEncode(xdata)
  6712. writefile(saveFileName, json)
  6713.  
  6714. MainModule()
  6715. --#endregion
  6716. end
  6717.  
  6718. --#region ----------------------
  6719. --#endregion
  6720. --------------------------------------------------
  6721.  
  6722. --[[
  6723. coroutine.resume(coroutine.create(function()
  6724. repeat task.wait() until game:GetService("Workspace"):WaitForChild("_UNITS")
  6725.  
  6726. unitTrackerTab = mainWindow:CreateTab("Unit Tracker")
  6727.  
  6728. while task.wait() do
  6729.  
  6730. local unitList = {}
  6731. local sections = {}
  6732. local toggles = {}
  6733.  
  6734. for i, v in ipairs(game:GetService("Workspace")["_UNITS"]:GetChildren()) do
  6735. if v:FindFirstChild("_stats") then
  6736. if tostring(v["_stats"].player.Value) == game.Players.LocalPlayer.Name and v["_stats"].xp.Value >= 0 then
  6737. table.insert(unitList, {v["_stats"]["id"].Value, v["_stats"]["upgrade"].Value, v})
  6738. end
  6739. end
  6740. end
  6741.  
  6742. for _, unit in pairs(unitList) do
  6743. local unitHolder = unitTrackerTab:CreateSection(unit[1] .. " (Upgrade [" .. tostring(unit[2]) .. " > " ..tostring(unit[2] + 1) .. "])")
  6744. table.insert(sections, unitHolder)
  6745. end
  6746.  
  6747. task.wait(3)
  6748.  
  6749. unitTrackerTab:Clear()
  6750. end
  6751. end))
  6752. --]]
  6753.  
  6754. ------// Auto Farm \\------
  6755. --#region Auto Farm Loop
  6756. PlaceUnits = function(mapName, waveNum, x, y, z)
  6757. local raycastParams = RaycastParams.new()
  6758.  
  6759. raycastParams.FilterType = Enum.RaycastFilterType.Whitelist
  6760. raycastParams.FilterDescendantsInstances = {game:GetService("Workspace")["_terrain"]}
  6761.  
  6762. local rayOrigin = CFrame.new(xPos, 1000, zPos).p
  6763. local rayDestination = CFrame.new(xPos, -1000, zPos).p
  6764.  
  6765. local rayDirection = (rayDestination - rayOrigin)
  6766.  
  6767. local raycastResult = workspace:Raycast(rayOrigin, rayDirection, raycastParams)
  6768.  
  6769. local units = {}
  6770.  
  6771. for i = 1, 6 do
  6772. local unitInfo = getgenv().SelectedUnits["U" .. i]
  6773. table.insert(units, {"U" .. i, unitInfo})
  6774. end
  6775.  
  6776. table.sort(units, function(a, b)
  6777. if tonumber(getgenv().unitPlacementSettings[a[1]]["placementPriority"]) ~= nil and tonumber(getgenv().unitPlacementSettings[b[1]]["placementPriority"]) ~= nil then
  6778. return tonumber(getgenv().unitPlacementSettings[a[1]]["placementPriority"]) > tonumber(getgenv().unitPlacementSettings[b[1]]["placementPriority"])
  6779. else
  6780. return false
  6781. end
  6782. end)
  6783.  
  6784. for i = 1, 6 do
  6785. print(i)
  6786. local unitinfo = units[i][2]
  6787. local spacer = 2
  6788.  
  6789. if unitinfo ~= nil then
  6790. if tonumber(getgenv().unitPlacementSettings[units[i][1]]["placeFromWave"]) <= tonumber(game:GetService("Workspace"):WaitForChild("_wave_num").Value) then
  6791. local unitinfo_ = unitinfo:split(" #")
  6792. local pos = getgenv().SpawnUnitPos[mapName][string.gsub(units[i][1], "U", "UP")]
  6793.  
  6794. for j = 1, 9 do
  6795.  
  6796. --if not ((unitinfo_[1] == "Bulmy" or unitinfo_[1] == "Speedcart") and waveNum < 4) then
  6797. local rayOrigin = CFrame.new(pos["x"] + (x * (((j - 1) % 3) - 1)), 1000, pos["z"] + (z * (math.ceil(j / 3) - 2))).p
  6798. local rayDestination = CFrame.new(pos["x"] + (x * (((j - 1) % 3) - 1)), -1000, pos["z"] + (z * (math.ceil(j / 3) - 2))).p
  6799. local rayDirection = (rayDestination - rayOrigin)
  6800.  
  6801. local raycastResult = workspace:Raycast(rayOrigin, rayDirection, raycastParams)
  6802.  
  6803. --place units
  6804. if raycastResult ~= nil then
  6805. if unitinfo_[1] == "metal_knight_evolved" then
  6806. task.spawn(function()
  6807. task.wait(j)
  6808. local args = {
  6809. [1] = unitinfo_[2],
  6810. [2] = CFrame.new(raycastResult.Position) * CFrame.Angles(0, -0, -0)
  6811. }
  6812. game:GetService("ReplicatedStorage").endpoints.client_to_server.spawn_unit:InvokeServer(unpack(args))
  6813. end)
  6814. else
  6815. local args = {
  6816. [1] = unitinfo_[2],
  6817. [2] = CFrame.new(raycastResult.Position) * CFrame.Angles(0, -0, -0)
  6818. }
  6819. game:GetService("ReplicatedStorage").endpoints.client_to_server.spawn_unit:InvokeServer(unpack(args))
  6820. end
  6821. end
  6822. end
  6823. end
  6824. end
  6825. end
  6826. end
  6827.  
  6828. coroutine.resume(coroutine.create(function()
  6829. local wave = 0
  6830.  
  6831. while task.wait(1.5) do
  6832. local _wave = game:GetService("Workspace"):WaitForChild("_wave_num").Value
  6833. if wave ~= _wave then
  6834. wave = game:GetService("Workspace"):WaitForChild("_wave_num").Value
  6835. pcall(function() BabyWebhook() end)
  6836. end
  6837.  
  6838. if getgenv().AutoFarm and not getgenv().disableAutoFarm and not getgenv().lockAutoFunctions then
  6839. if game.PlaceId ~= 8304191830 then
  6840. --print("AutoFarming")
  6841. xOffset = 2
  6842. yOffset = -0.5
  6843. zOffset = 2
  6844.  
  6845. repeat task.wait() until game:GetService("Workspace"):WaitForChild("_map")
  6846.  
  6847. if game.Workspace._map:FindFirstChild("namek mushroom model") then
  6848. print("Namak")
  6849. PlaceUnits("Namak", _wave, xOffset, yOffset, zOffset)
  6850. elseif game.Workspace._map:FindFirstChild("houses_new") then
  6851. print("Aot")
  6852. PlaceUnits("Aot", _wave, xOffset, yOffset, zOffset)
  6853. elseif game.Workspace._map:FindFirstChild("Snow Particles") then
  6854. print("Snowy")
  6855. PlaceUnits("Snowy", _wave, xOffset, yOffset, zOffset)
  6856. elseif game.Workspace._map:FindFirstChild("sand_gate") then
  6857. print("Sand")
  6858. PlaceUnits("Sand", _wave, xOffset, yOffset, zOffset)
  6859. elseif game.Workspace._map:FindFirstChild("icebergs") then
  6860. print("Marine")
  6861. PlaceUnits("Marine", _wave, xOffset, yOffset, zOffset)
  6862. elseif game.Workspace._map:FindFirstChild("Helicopter Pad") then
  6863. print("Ghoul")
  6864. PlaceUnits("Ghoul", _wave, xOffset, yOffset, zOffset)
  6865. elseif game.Workspace._map:FindFirstChild("Bones/dust") then
  6866. print("Hollow")
  6867. PlaceUnits("Hollow", _wave, xOffset, yOffset, zOffset)
  6868. elseif game.Workspace._map:FindFirstChild("Ant Nest") then
  6869. print("Ant")
  6870. PlaceUnits("Ant", _wave, xOffset, yOffset, zOffset)
  6871. elseif game.Workspace._map:FindFirstChild("light poles") then
  6872. print("Magic")
  6873. PlaceUnits("Magic", _wave, xOffset, yOffset, zOffset)
  6874. elseif game.Workspace._map:FindFirstChild("LanternsGround") then
  6875. print("Cursed")
  6876. PlaceUnits("Cursed", _wave, xOffset, yOffset, zOffset)
  6877. elseif game.Workspace._map:FindFirstChild("pumpkins") then
  6878. print("thriller_park")
  6879. PlaceUnits("thriller_park", _wave, xOffset, yOffset, zOffset)
  6880. elseif game.Workspace._map:FindFirstChild("skeleton") then
  6881. print("black_clover")
  6882. PlaceUnits("black_clover", _wave, xOffset, yOffset, zOffset)
  6883. elseif game.Workspace._map:FindFirstChild("graves") then
  6884. print("Hollow Legend")
  6885. PlaceUnits("hollow_leg", _wave, xOffset, yOffset, zOffset)
  6886. elseif game.Workspace._map:FindFirstChild("SpaceCenter") then
  6887. print("Cape Canaveral")
  6888. PlaceUnits("jojo", _wave, xOffset, yOffset, zOffset)
  6889. elseif game.Workspace._map:FindFirstChild("Big_Stairs") then
  6890. print("Chainsaw Man")
  6891. PlaceUnits("csm_event", _wave, xOffset, yOffset, zOffset)
  6892. elseif game.Workspace._map:FindFirstChild("Capybara") then
  6893. print("One Punch Man")
  6894. PlaceUnits("opm", _wave, xOffset, yOffset, zOffset)
  6895. else
  6896. print("Something bad happened")
  6897. end
  6898. end
  6899. end
  6900.  
  6901. if getgenv().autoUpgrade then
  6902. if game.PlaceId ~= 8304191830 then
  6903. pcall(function()
  6904. autoUpgradefunc()
  6905. end)
  6906. end
  6907. if getgenv().autoUpgrader == true then
  6908. task.wait()
  6909. autoUpgradefunc()
  6910. getgenv().autoUpgrader = false
  6911. end
  6912. end
  6913. end
  6914. end))
  6915. --#endregion
  6916.  
  6917.  
  6918.  
  6919. ------// Auto Leave \\------
  6920. --#region Auto Leave
  6921.  
  6922.  
  6923.  
  6924. --- Made by "CharWar" # Modified by "binsfr" (V3rm)
  6925. local PlaceID = 8304191830
  6926. local AllIDs = {}
  6927. local foundAnything = ""
  6928. local actualHour = os.date("!*t").hour
  6929. local Deleted = false
  6930.  
  6931. local last
  6932.  
  6933. local File = pcall(function()
  6934. AllIDs = game:GetService('HttpService'):JSONDecode(readfile("NotSameServers.json"))
  6935. end)
  6936. if not File then
  6937. table.insert(AllIDs, actualHour)
  6938. writefile("NotSameServers.json", game:GetService('HttpService'):JSONEncode(AllIDs))
  6939. end
  6940.  
  6941. function TPReturner()
  6942. local Site;
  6943. if foundAnything == "" then
  6944. Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100'))
  6945. else
  6946. Site = game.HttpService:JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. PlaceID .. '/servers/Public?sortOrder=Asc&limit=100&cursor=' .. foundAnything))
  6947. end
  6948. local ID = ""
  6949. if Site.nextPageCursor and Site.nextPageCursor ~= "null" and Site.nextPageCursor ~= nil then
  6950. foundAnything = Site.nextPageCursor
  6951. end
  6952. local num = 0;
  6953. local extranum = 0
  6954. for i, v in pairs(Site.data) do
  6955. extranum += 1
  6956. local Possible = true
  6957. ID = tostring(v.id)
  6958. if tonumber(v.maxPlayers) > tonumber(v.playing) then
  6959. if extranum ~= 1 and tonumber(v.playing) < last or extranum == 1 then
  6960. last = tonumber(v.playing)
  6961. elseif extranum ~= 1 then
  6962. continue
  6963. end
  6964. for _,Existing in pairs(AllIDs) do
  6965. if num ~= 0 then
  6966. if ID == tostring(Existing) then
  6967. Possible = false
  6968. end
  6969. else
  6970. if tonumber(actualHour) ~= tonumber(Existing) then
  6971. local delFile = pcall(function()
  6972. delfile("NotSameServers.json")
  6973. AllIDs = {}
  6974. table.insert(AllIDs, actualHour)
  6975. end)
  6976. end
  6977. end
  6978. num = num + 1
  6979. end
  6980. if Possible == true then
  6981. table.insert(AllIDs, ID)
  6982. wait()
  6983. if getgenv().isAlt ~= true then
  6984. writefile("NotSameServers.json", game:GetService('HttpService'):JSONEncode(AllIDs))
  6985. wait()
  6986. writefile("TeleportTo.lua", "game:GetService(\"TeleportService\"):TeleportToPlaceInstance(" .. PlaceID ..",\"".. ID.."\", game.Players.LocalPlayer)")
  6987. task.wait(5)
  6988. loadfile("TeleportTo.lua")()
  6989. end
  6990. task.wait(400)
  6991. end
  6992. end
  6993. end
  6994. end
  6995.  
  6996. function Teleport()
  6997. if getgenv().isAlt ~= true then
  6998. while wait() do
  6999. pcall(function()
  7000. TPReturner()
  7001. if foundAnything ~= "" then
  7002. TPReturner()
  7003. end
  7004. end)
  7005. end
  7006. else
  7007. repeat
  7008. task.wait()
  7009. local mainAccountFound = false
  7010. for _, v in pairs(game.Players:GetPlayers()) do
  7011. if tostring(v) == getgenv().mainAccount then
  7012. mainAccountFound = true
  7013. end
  7014. end
  7015. until mainAccountFound == false
  7016. task.wait(5)
  7017. loadfile("TeleportTo.lua")()
  7018. end
  7019. end
  7020. -------------------------------------------
  7021.  
  7022. coroutine.resume(coroutine.create(function()
  7023. local GameFinished = game:GetService("Workspace"):WaitForChild("_DATA"):WaitForChild("GameFinished")
  7024. GameFinished:GetPropertyChangedSignal("Value"):Connect(function()
  7025. print("Changed", GameFinished.Value == true)
  7026. if GameFinished.Value == true then
  7027. getgenv().recordingMacro = false
  7028. updatejson()
  7029. repeat task.wait() until game:GetService("Players").LocalPlayer.PlayerGui.ResultsUI.Enabled == true
  7030. task.wait()
  7031. pcall(function() Webhook() end)
  7032. pcall(function() NormalItemWebhook() end)
  7033. pcall(function() UniqueWebhook() end)
  7034. print("next button pressed")
  7035. task.wait(2.1)
  7036.  
  7037. if getgenv().AutoFarmIC then
  7038. for i = 1, 25 do
  7039. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_start_infinite_tower_from_game:InvokeServer()
  7040. task.wait(1)
  7041. end
  7042. end
  7043.  
  7044. if getgenv().AutoContinue then
  7045.  
  7046. if game:GetService("Players").LocalPlayer.PlayerGui.ResultsUI.bg:FindFirstChild("Win") ~= nil then
  7047. getgenv().level = GetNextLevel(GetCurrentLevelId())
  7048. task.wait(10)
  7049. local args = {
  7050. [1] = "next_story"
  7051. }
  7052. for i = 1, 25 do
  7053. task.wait(1)
  7054. game:GetService("ReplicatedStorage").endpoints.client_to_server.set_game_finished_vote:InvokeServer(unpack(args))
  7055. end
  7056. else
  7057. getgenv().level = GetCurrentLevelId()
  7058. updatejson()
  7059. if getgenv().isAlt ~= true then
  7060. Teleport()
  7061. end
  7062. end
  7063. updatejson()
  7064. end
  7065.  
  7066. if getgenv().AutoReplay then
  7067. for i = 1, 25 do
  7068. local a={[1]="replay"} game:GetService("ReplicatedStorage").endpoints.client_to_server.set_game_finished_vote:InvokeServer(unpack(a))
  7069. task.wait(1)
  7070. end
  7071. elseif getgenv().AutoLeave then
  7072. if getgenv().isAlt then
  7073. repeat
  7074. task.wait(1)
  7075. local mainAccountFound = false
  7076. for _, v in pairs(game.Players:GetPlayers()) do
  7077. if tostring(v) == getgenv().mainAccount then
  7078. mainAccountFound = true
  7079. end
  7080. end
  7081. until mainAccountFound == false
  7082. Teleport()
  7083. else
  7084. Teleport()
  7085. end
  7086. end
  7087. end
  7088. end)
  7089. end))
  7090. --#endregion
  7091.  
  7092. ------// Auto Sell Units \\------
  7093. coroutine.resume(coroutine.create(function()
  7094. while task.wait() do
  7095. if getgenv().UnitSellTog then
  7096.  
  7097. for i, v in pairs(game:GetService("Players")[game.Players.LocalPlayer.Name].PlayerGui.collection.grid.List.Outer.UnitFrames:GetChildren()) do
  7098. if v.Name == "CollectionUnitFrame" then
  7099. repeat task.wait() until v:FindFirstChild("name")
  7100. for _, Info in next, getgenv().UnitCache do
  7101. if Info.name == v.name.Text and Info.rarity == getgenv().UnitToSell then
  7102. local args = {
  7103. [1] = {
  7104. [1] = tostring(v._uuid.Value)
  7105. }
  7106. }
  7107. game:GetService("ReplicatedStorage").endpoints.client_to_server.sell_units:InvokeServer(unpack(args))
  7108. end
  7109. end
  7110. end
  7111. end
  7112.  
  7113. end
  7114. end
  7115. end))
  7116.  
  7117. ------// Auto Upgrade \\------
  7118. --#region Auto Upgrade Loop
  7119. getgenv().autoUpgrader = false
  7120.  
  7121. function autoUpgradefunc()
  7122. if not getgenv().lockAutoFunctions then
  7123. repeat task.wait() until game:GetService("Workspace"):WaitForChild("_UNITS")
  7124.  
  7125. unitList = {}
  7126. for i, v in ipairs(game:GetService("Workspace")["_UNITS"]:GetChildren()) do
  7127. if v:FindFirstChild("_stats") and v:FindFirstChild("_hitbox") then
  7128. if tostring(v["_stats"].player.Value) == game.Players.LocalPlayer.Name and v["_stats"].xp.Value >= 0 then
  7129. table.insert(unitList, {v["_stats"]["id"].Value, v["_stats"]["uuid"].Value, v, v["_stats"]["upgrade"].Value})
  7130. end
  7131. end
  7132. end
  7133.  
  7134. local currentUnitUUIDs = {}
  7135. for i = 1, 6 do
  7136. local unitUUID = getgenv().SelectedUnits["U" .. i]:split(" #")[2]
  7137. table.insert(currentUnitUUIDs, {"U" .. i, unitUUID})
  7138. end
  7139.  
  7140. table.sort(unitList, function(a, b)
  7141. local unitAFound = false
  7142. local unitBFound = false
  7143.  
  7144. for i = 1, 6 do
  7145. if currentUnitUUIDs[i][2] == a[2] then
  7146. unitAFound = true
  7147. end
  7148. end
  7149.  
  7150. for i = 1, 6 do
  7151. if currentUnitUUIDs[i][2] == b[2] then
  7152. unitBFound = true
  7153. end
  7154. end
  7155.  
  7156. if (unitAFound == false and unitBFound == false) then
  7157. return true
  7158. elseif (unitAFound == true and unitBFound == false) then
  7159. return true
  7160. elseif (unitAFound == false and unitBFound == true) then
  7161. return false
  7162. else
  7163. local unitAIdentifier
  7164. local unitBIdentifier
  7165.  
  7166. for i = 1, 6 do
  7167. if currentUnitUUIDs[i][2] == a[2] then
  7168. unitAIdentifier = currentUnitUUIDs[i][1]
  7169. end
  7170. end
  7171.  
  7172. for i = 1, 6 do
  7173. if currentUnitUUIDs[i][2] == b[2] then
  7174. unitBIdentifier = currentUnitUUIDs[i][1]
  7175. end
  7176. end
  7177.  
  7178. if tonumber(getgenv().unitPlacementSettings[unitAIdentifier]["upgradePriority"]) ~= nil and tonumber(getgenv().unitPlacementSettings[unitBIdentifier]["upgradePriority"]) ~= nil then
  7179. return tonumber(getgenv().unitPlacementSettings[unitAIdentifier]["upgradePriority"]) > tonumber(getgenv().unitPlacementSettings[unitBIdentifier]["upgradePriority"])
  7180. end
  7181. end
  7182. end)
  7183. for _, unitEntry in pairs(unitList) do
  7184.  
  7185. for i = 1, 6 do
  7186. if currentUnitUUIDs[i][2] == unitEntry[2] then
  7187. localIdentifier = currentUnitUUIDs[i][1]
  7188. end
  7189. end
  7190. print("localIDENT"..localIdentifier)
  7191. if localIdentifier ~= nil then
  7192. if tonumber(getgenv().unitPlacementSettings[localIdentifier]["upgradeFromWave"]) < game:GetService("Workspace"):WaitForChild("_wave_num").Value and tonumber(getgenv().unitPlacementSettings[localIdentifier]["upgradeCap"]) > unitEntry[4] and unitEntry[1] ~= "metal_knight_drone" and unitEntry[1] ~= "metal_knight_drone:shiny" then
  7193. game:GetService("ReplicatedStorage").endpoints.client_to_server.upgrade_unit_ingame:InvokeServer(unitEntry[3])
  7194. end
  7195. end
  7196. end
  7197. end
  7198. end
  7199.  
  7200. --#endregion
  7201.  
  7202.  
  7203. ------// Auto Sell/Quit \\------
  7204. --#region Auto Sell/Quit loop
  7205. coroutine.resume(coroutine.create(function()
  7206. while task.wait(1.5) do
  7207. if not getgenv().lockAutoFunctions then
  7208. local _wave = game:GetService("Workspace"):WaitForChild("_wave_num")
  7209. if getgenv().autoQuit and tonumber(getgenv().quitAtWave) <= _wave.Value then
  7210. Teleport()
  7211. end
  7212.  
  7213. if getgenv().autoSell and tonumber(getgenv().sellatwave) <= _wave.Value then
  7214. getgenv().disableAutoFarm = true
  7215. if game.PlaceId ~= 8304191830 then
  7216. repeat task.wait() until game:GetService("Workspace"):WaitForChild("_UNITS")
  7217. for i, v in ipairs(game:GetService("Workspace")["_UNITS"]:GetChildren()) do
  7218. repeat
  7219. task.wait()
  7220. until v:WaitForChild("_stats")
  7221. if tostring(v["_stats"].player.Value) == game.Players.LocalPlayer.Name then
  7222. repeat task.wait() until v:WaitForChild("_stats"):WaitForChild("upgrade")
  7223. game:GetService("ReplicatedStorage").endpoints.client_to_server.sell_unit_ingame:InvokeServer(v)
  7224. end
  7225. end
  7226. end
  7227. end
  7228. end
  7229. end
  7230. end))
  7231. --#endregion
  7232.  
  7233. --//Auto Abilities--
  7234. --#region Auto Abilities loop
  7235. getgenv().autoabilityerr = false
  7236.  
  7237. function autoabilityfunc()
  7238. local success, err = pcall(function() --///
  7239. if not getgenv().lockAutoFunctions then
  7240. repeat task.wait() until game:GetService("Workspace"):WaitForChild("_UNITS")
  7241. for i, v in ipairs(game:GetService("Workspace")["_UNITS"]:GetChildren()) do
  7242. if v:FindFirstChild("_stats") then
  7243. if v._stats:FindFirstChild("player") and v._stats:FindFirstChild("xp") then
  7244. if tostring(v["_stats"].player.Value) == game.Players.LocalPlayer.Name and v["_stats"].xp.Value > 0 then
  7245. game:GetService("ReplicatedStorage").endpoints.client_to_server.use_active_attack:InvokeServer(v)
  7246. end
  7247. end
  7248. end
  7249. end
  7250. end
  7251. end)
  7252.  
  7253. if err then
  7254. warn("//////////////////////////////////////////////////")
  7255. warn("//////////////////////////////////////////////////")
  7256. getgenv().autoabilityerr = true
  7257. error(err)
  7258. end
  7259.  
  7260. end
  7261.  
  7262. coroutine.resume(coroutine.create(function()
  7263.  
  7264. while task.wait(2) do
  7265. if getgenv().autoabilities then
  7266. if game.PlaceId ~= 8304191830 then
  7267. pcall(function()
  7268. autoabilityfunc()
  7269. end)
  7270. end
  7271. if getgenv().autoabilityerr == true then
  7272. task.wait()
  7273. autoabilityfunc()
  7274. getgenv().autoabilityerr = false
  7275. end
  7276. end
  7277. end
  7278.  
  7279. end))
  7280. --#endregion
  7281.  
  7282.  
  7283. getgenv().teleporting = true
  7284.  
  7285. ------// Auto Start \\------
  7286. --#region Auto Start loop
  7287.  
  7288. local function checkChallenge()
  7289. for i,v in pairs(game.Players.LocalPlayer.PlayerGui:GetChildren()) do
  7290. if v:IsA("SurfaceGui") then
  7291. if v:FindFirstChild("ChallengeCleared") then
  7292. --print(v.ChallengeCleared.Visible)
  7293. return v.ChallengeCleared.Visible
  7294. end
  7295. end
  7296. end
  7297. end
  7298.  
  7299. local function checkReward()
  7300. if checkChallenge() == false then
  7301. if getgenv().selectedreward == game:GetService("Workspace")["_LOBBIES"]["_DATA"]["_CHALLENGE"]["current_reward"].Value then
  7302. return true
  7303. elseif getgenv().AutoChallengeAll then
  7304. return true
  7305. else
  7306. return false
  7307. end
  7308. else
  7309. return false
  7310. end
  7311. end
  7312.  
  7313. local function startfarming()
  7314. task.wait(1)
  7315. if getgenv().autoStart and getgenv().AutoFarm and getgenv().teleporting
  7316. and getgenv().AutoFarmTP == false and getgenv().AutoFarmIC == false then
  7317. if game.PlaceId == 8304191830 then
  7318. local cpos = player.Character.HumanoidRootPart.CFrame
  7319.  
  7320. if not getgenv().isAlt then
  7321. if getgenv().altMode then
  7322. repeat
  7323. task.wait(1)
  7324. local altsInGame = 0
  7325. for _, val in pairs(game.Players:GetPlayers()) do
  7326. for i, alt in pairs(getgenv().altList) do
  7327. if tostring(val.Name) == tostring(alt) then
  7328. print(val.Name)
  7329. altsInGame += 1
  7330. break
  7331. end
  7332. end
  7333. end
  7334. until altsInGame >= getgenv().altCount
  7335. end
  7336.  
  7337. if getgenv().autoRaid then
  7338. if Workspace._RAID.Raid:FindFirstChild(getgenv().raiddoor) then
  7339. if tostring(Workspace._RAID.Raid[getgenv().raiddoor].Owner.Value) ~= player.Name then
  7340. for i, v in pairs(game:GetService("Workspace")["_RAID"].Raid:GetDescendants()) do
  7341. if v.Name == "Owner" and v.Value == nil then
  7342. local args = {
  7343. [1] = tostring(v.Parent.Name)
  7344. }
  7345. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_join_lobby:InvokeServer(unpack(args))
  7346.  
  7347. local args = {
  7348. [1] = tostring(v.Parent.Name), -- Lobby
  7349. [2] = getgenv().raidLevel, -- World
  7350. [3] = true, -- Friends Only or not
  7351. [4] = "Hard"
  7352. }
  7353. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_lock_level:InvokeServer(unpack(args))
  7354.  
  7355. local altsInGame = false
  7356.  
  7357. for _, val in pairs(game.Players:GetPlayers()) do
  7358. for i, alt in pairs(getgenv().altList) do
  7359. if tostring(val.Name) == tostring(alt) then
  7360. altsInGame = true
  7361. break
  7362. end
  7363. end
  7364. end
  7365.  
  7366. if altsInGame then
  7367. repeat
  7368. task.wait(1)
  7369. print(v.Parent.Timer.Value)
  7370. if v.Parent.Timer.Value <= 50 then
  7371. local leave_args = {
  7372. [1] = v.Parent.Name
  7373. }
  7374.  
  7375. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_leave_lobby:InvokeServer(unpack(leave_args))
  7376. break
  7377. end
  7378. until #v.Parent.Players:GetChildren() >= getgenv().altCount + 1
  7379.  
  7380. local args = {
  7381. [1] = tostring(v.Parent.Name)
  7382. }
  7383.  
  7384. task.wait(0.1)
  7385. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_start_game:InvokeServer(unpack(args))
  7386. getgenv().raiddoor = v.Parent.Name print(v.Parent.Name) --v.Parent:GetFullName()
  7387. player.Character.HumanoidRootPart.CFrame = v.Parent.Door.CFrame
  7388. break
  7389. else
  7390. local args = {
  7391. [1] = tostring(v.Parent.Name)
  7392. }
  7393.  
  7394. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_start_game:InvokeServer(unpack(args))
  7395. getgenv().raiddoor = v.Parent.Name print(v.Parent.Name) --v.Parent:GetFullName()
  7396. player.Character.HumanoidRootPart.CFrame = v.Parent.Door.CFrame
  7397. return(1)
  7398. end
  7399. end
  7400. end
  7401. end
  7402. end
  7403. return(1)
  7404. end
  7405.  
  7406. if getgenv().autoPortal then
  7407. for _, val in pairs(game.Players:GetPlayers()) do
  7408. print(val.Name)
  7409. for i, alt in pairs(getgenv().altList) do
  7410. if tostring(val.Name) == tostring(alt) then
  7411. altsInGame = true
  7412. break
  7413. end
  7414. end
  7415. end
  7416.  
  7417. local args = {
  7418. [1] = getBorosPortals()[1]["uuid"],
  7419. [2] = {
  7420. ["friends_only"] = true
  7421. }
  7422. }
  7423.  
  7424. game:GetService("ReplicatedStorage").endpoints.client_to_server.use_portal:InvokeServer(unpack(args))
  7425.  
  7426. for i, v in pairs(game:GetService("Workspace")["_PORTALS"].Lobbies:GetDescendants()) do
  7427. if v.Name == "Owner" and tostring(v.Value) == getgenv().mainAccount then
  7428. if altsInGame then
  7429. repeat
  7430. task.wait(1)
  7431. print(v.Parent.Timer.Value)
  7432. if v.Parent.Timer.Value <= 50 then
  7433. local leave_args = {
  7434. [1] = v.Parent.Name
  7435. }
  7436.  
  7437. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_leave_lobby:InvokeServer(unpack(leave_args))
  7438. break
  7439. end
  7440. until #v.Parent.Players:GetChildren() >= getgenv().altCount + 1
  7441. end
  7442.  
  7443. local args = {
  7444. [1] = v.Parent.Name
  7445. }
  7446. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_start_game:InvokeServer(unpack(args))
  7447. return(1)
  7448. end
  7449. end
  7450. return(1)
  7451. end
  7452.  
  7453. if getgenv().autoPortalCSM then
  7454. for _, val in pairs(game.Players:GetPlayers()) do
  7455. print(val.Name)
  7456. for i, alt in pairs(getgenv().altList) do
  7457. if tostring(val.Name) == tostring(alt) then
  7458. altsInGame = true
  7459. break
  7460. end
  7461. end
  7462. end
  7463.  
  7464. local args = {
  7465. [1] = getCSMPortals()[1]["uuid"],
  7466. [2] = {
  7467. ["friends_only"] = true
  7468. }
  7469. }
  7470.  
  7471. game:GetService("ReplicatedStorage").endpoints.client_to_server.use_portal:InvokeServer(unpack(args))
  7472.  
  7473. for i, v in pairs(game:GetService("Workspace")["_PORTALS"].Lobbies:GetDescendants()) do
  7474. if v.Name == "Owner" and tostring(v.Value) == getgenv().mainAccount then
  7475. if altsInGame then
  7476. repeat
  7477. task.wait(1)
  7478. print(v.Parent.Timer.Value)
  7479. if v.Parent.Timer.Value <= 50 then
  7480. local leave_args = {
  7481. [1] = v.Parent.Name
  7482. }
  7483.  
  7484. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_leave_lobby:InvokeServer(unpack(leave_args))
  7485. break
  7486. end
  7487. until #v.Parent.Players:GetChildren() >= getgenv().altCount + 1
  7488. end
  7489.  
  7490. local args = {
  7491. [1] = v.Parent.Name
  7492. }
  7493. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_start_game:InvokeServer(unpack(args))
  7494. return(1)
  7495. end
  7496. end
  7497. end
  7498.  
  7499. if Workspace._LOBBIES.Story:FindFirstChild(getgenv().door) then
  7500. if tostring(Workspace._LOBBIES.Story[getgenv().door].Owner.Value) ~= player.Name and not getgenv().autoRaid then
  7501. for i, v in pairs(game:GetService("Workspace")["_LOBBIES"].Story:GetDescendants()) do
  7502. if v.Name == "Owner" and v.Value == nil then
  7503. local args = {
  7504. [1] = tostring(v.Parent.Name)
  7505. }
  7506. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_join_lobby:InvokeServer(unpack(args))
  7507.  
  7508. task.wait()
  7509.  
  7510. if getgenv().level:match("infinite") then
  7511. local args = {
  7512. [1] = tostring(v.Parent.Name), -- Lobby
  7513. [2] = getgenv().level, -- World
  7514. [3] = true, -- Friends Only or not
  7515. [4] = "Hard"
  7516. }
  7517. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_lock_level:InvokeServer(unpack(args))
  7518. else
  7519. local args = {
  7520. [1] = tostring(v.Parent.Name), -- Lobby
  7521. [2] = getgenv().level, -- World
  7522. [3] = true, -- Friends Only or not
  7523. [4] = getgenv().difficulty
  7524. }
  7525. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_lock_level:InvokeServer(unpack(args))
  7526. end
  7527.  
  7528. local altsInGame = false
  7529.  
  7530. for _, val in pairs(game.Players:GetPlayers()) do
  7531. print(val.Name)
  7532. for i, alt in pairs(getgenv().altList) do
  7533. if tostring(val.Name) == tostring(alt) then
  7534. altsInGame = true
  7535. break
  7536. end
  7537. end
  7538. end
  7539.  
  7540. if altsInGame then
  7541. repeat
  7542. task.wait(1)
  7543. print(v.Parent.Timer.Value)
  7544. if v.Parent.Timer.Value <= 50 then
  7545. local leave_args = {
  7546. [1] = v.Parent.Name
  7547. }
  7548.  
  7549. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_leave_lobby:InvokeServer(unpack(leave_args))
  7550. break
  7551. end
  7552. until #v.Parent.Players:GetChildren() >= getgenv().altCount + 1
  7553.  
  7554. local args = {
  7555. [1] = tostring(v.Parent.Name)
  7556. }
  7557.  
  7558. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_start_game:InvokeServer(unpack(args))
  7559. getgenv().door = v.Parent.Name print(v.Parent.Name) --v.Parent:GetFullName()
  7560. player.Character.HumanoidRootPart.CFrame = v.Parent.Door.CFrame
  7561. break
  7562. else
  7563. local args = {
  7564. [1] = tostring(v.Parent.Name)
  7565. }
  7566.  
  7567. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_start_game:InvokeServer(unpack(args))
  7568. getgenv().door = v.Parent.Name print(v.Parent.Name) --v.Parent:GetFullName()
  7569. player.Character.HumanoidRootPart.CFrame = v.Parent.Door.CFrame
  7570. break
  7571. end
  7572. end
  7573. end
  7574. end
  7575. end
  7576. else
  7577. local timer = 0
  7578. local mainAccountFound = false
  7579. repeat
  7580. task.wait(1)
  7581. timer += 1
  7582. mainAccountFound = false
  7583. for _, v in pairs(game.Players:GetPlayers()) do
  7584. if tostring(v) == getgenv().mainAccount then
  7585. mainAccountFound = true
  7586. print("FOUND")
  7587. end
  7588. end
  7589. until mainAccountFound
  7590.  
  7591. if mainAccountFound ~= true then
  7592. loadfile("TeleportTo.lua")()
  7593. end
  7594.  
  7595. local inMainLobby = false
  7596.  
  7597. repeat
  7598. print("WAITING ON MAIN TO SET LEVEL")
  7599. for i, v in pairs(game:GetService("Workspace")["_LOBBIES"].Story:GetDescendants()) do
  7600. if v.Name == "Owner" and tostring(v.Value) == getgenv().mainAccount then
  7601. for _, val in pairs(v.Parent:GetDescendants()) do
  7602. if val.Name == "TouchInterest" and val.Parent then
  7603. firetouchinterest(game.Players.LocalPlayer.Character.Head, val.Parent, 0)
  7604. task.wait(0.1)
  7605. firetouchinterest(game.Players.LocalPlayer.Character.Head, val.Parent, 1)
  7606. task.wait(0.1)
  7607. end
  7608. end
  7609. end
  7610. end
  7611. for i, v in pairs(game:GetService("Workspace")["_EVENT_CHALLENGES"].Lobbies:GetDescendants()) do
  7612. if v.Name == "Owner" and tostring(v.Value) == getgenv().mainAccount then
  7613. for _, val in pairs(v.Parent:GetDescendants()) do
  7614. if val.Name == "TouchInterest" and val.Parent then
  7615. firetouchinterest(game.Players.LocalPlayer.Character.Head, val.Parent, 0)
  7616. task.wait(0.1)
  7617. firetouchinterest(game.Players.LocalPlayer.Character.Head, val.Parent, 1)
  7618. task.wait(0.1)
  7619. end
  7620. end
  7621. end
  7622. end
  7623. for i, v in pairs(game:GetService("Workspace")["_PORTALS"].Lobbies:GetDescendants()) do
  7624. if v.Name == "Owner" and tostring(v.Value) == getgenv().mainAccount then
  7625. local args = {
  7626. [1] = v.Parent.Name
  7627. }
  7628. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_join_lobby:InvokeServer(unpack(args))
  7629. end
  7630. end
  7631. task.wait(0.5)
  7632. until (inMainLobby == true)
  7633. end
  7634. task.wait()
  7635.  
  7636. player.Character.HumanoidRootPart.CFrame = cpos
  7637.  
  7638. if not getgenv().isAlt then
  7639. if Workspace._RAID.Raid:FindFirstChild(getgenv().raiddoor) then
  7640. if Workspace._RAID.Raid[getgenv().raiddoor].Owner == player.Name then
  7641. if Workspace._RAID.Raid[getgenv().door].Teleporting.Value == true then
  7642. getgenv().teleporting = false
  7643. else
  7644. getgenv().teleporting = true
  7645. end
  7646. end
  7647. end
  7648.  
  7649. if Workspace._LOBBIES.Story:FindFirstChild(getgenv().door) then
  7650. if Workspace._LOBBIES.Story[getgenv().door].Owner == player.Name then
  7651. if Workspace._LOBBIES.Story[getgenv().door].Teleporting.Value == true then
  7652. getgenv().teleporting = false
  7653. else
  7654. getgenv().teleporting = true
  7655. end
  7656. end
  7657. end
  7658.  
  7659. else
  7660. if Workspace._RAID.Raid:FindFirstChild(getgenv().raiddoor) then
  7661. if tostring(Workspace._RAID.Raid[getgenv().raiddoor].Owner) == getgenv().mainAccount then
  7662. if Workspace._RAID.Raid[getgenv().door].Teleporting.Value == true then
  7663. getgenv().teleporting = false
  7664. else
  7665. getgenv().teleporting = true
  7666. end
  7667. end
  7668. end
  7669.  
  7670. if Workspace._LOBBIES.Story:FindFirstChild(getgenv().door) then
  7671. if tostring(Workspace._RAID.Raid[getgenv().door].Owner) == getgenv().mainAccount then
  7672. if Workspace._LOBBIES.Story[getgenv().door].Teleporting.Value == true then
  7673. getgenv().teleporting = false
  7674. else
  7675. getgenv().teleporting = true
  7676. end
  7677. end
  7678. end
  7679. end
  7680.  
  7681. warn("farming")
  7682. task.wait(3)
  7683.  
  7684. end
  7685. end
  7686. end
  7687.  
  7688. local function startChallenge()
  7689. if game.PlaceId == 8304191830 then
  7690. local cpos = player.Character.HumanoidRootPart.CFrame
  7691.  
  7692. if getgenv().AutoChallenge and getgenv().autoStart and getgenv().AutoFarm and checkReward() == true then
  7693.  
  7694. for i, v in pairs(game:GetService("Workspace")["_CHALLENGES"].Challenges:GetDescendants()) do
  7695. if v.Name == "Owner" and v.Value == nil then
  7696. --print(v.Parent.Name.." "..v.Parent:GetFullName())
  7697. local args = {
  7698. [1] = tostring(v.Parent.Name)
  7699. }
  7700. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_join_lobby:InvokeServer(unpack(args))
  7701.  
  7702. getgenv().chdoor = v.Parent.Name
  7703. break
  7704. end
  7705. end
  7706. task.wait()
  7707. player.Character.HumanoidRootPart.CFrame = cpos
  7708.  
  7709. end
  7710. end
  7711. end
  7712.  
  7713. coroutine.resume(coroutine.create(function()
  7714. while task.wait() do
  7715. if getgenv().AutoFarmIC == false and getgenv().AutoFarmTP == false then
  7716. if checkChallenge() == false then --challenge is not cleared
  7717. if getgenv().AutoChallenge and checkReward() == true then
  7718. startChallenge() --start challenge
  7719. else
  7720. startfarming()--regular farming
  7721. end
  7722. elseif checkChallenge() == true then
  7723. startfarming()--regular farming
  7724. end
  7725. end
  7726. end
  7727. end))
  7728. --#endregion
  7729.  
  7730.  
  7731. ------// Auto Start Infinity Castle && Thriller Park \\------
  7732.  
  7733. local function FarmCastlePark()
  7734. if getgenv().AutoFarmIC and getgenv().AutoFarm then
  7735. if game.PlaceId == 8304191830 then
  7736.  
  7737. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(12423.1855, 155.24025, 3198.07593, -1.34111269e-06, -2.02512282e-08, 1, 3.91705386e-13, 1, 2.02512282e-08, -1, 4.18864542e-13, -1.34111269e-06)
  7738.  
  7739. getgenv().infinityroom = 0
  7740.  
  7741. for i, v in pairs(game:GetService("Players")[game.Players.LocalPlayer.Name].PlayerGui.InfiniteTowerUI.LevelSelect.InfoFrame.LevelButtons:GetChildren()) do
  7742. if v.Name == "FloorButton" then
  7743. if v.clear.Visible == false and v.Locked.Visible == false then
  7744. local room = string.split(v.Main.text.Text, " ")
  7745.  
  7746. local args = {
  7747. [1] = tonumber(room[2])
  7748. }
  7749.  
  7750. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_start_infinite_tower:InvokeServer(unpack(args))
  7751. getgenv().infinityroom = tonumber(room[2])
  7752. break
  7753. end
  7754. end
  7755. end
  7756.  
  7757. task.wait(6)
  7758. end
  7759. elseif getgenv().AutoFarmTP and getgenv().AutoFarm then
  7760. if game.PlaceId == 8304191830 then
  7761.  
  7762. local cpos = player.Character.HumanoidRootPart.CFrame
  7763.  
  7764. for i, v in pairs(game:GetService("Workspace")["_EVENT_CHALLENGES"].Lobbies:GetDescendants()) do
  7765. if v.Name == "Owner" and v.Value == nil then
  7766.  
  7767. local args = {
  7768. [1] = tostring(v.Parent.Name)
  7769. }
  7770.  
  7771. game:GetService("ReplicatedStorage").endpoints.client_to_server.request_join_lobby:InvokeServer(unpack(args))
  7772.  
  7773. task.wait()
  7774.  
  7775. player.Character.HumanoidRootPart.CFrame = v.Parent.Door.CFrame
  7776. break
  7777. end
  7778. end
  7779.  
  7780. task.wait()
  7781.  
  7782. player.Character.HumanoidRootPart.CFrame = cpos
  7783. warn("farming")
  7784. task.wait(5)
  7785.  
  7786. end
  7787. end
  7788. end
  7789.  
  7790. coroutine.resume(coroutine.create(function()
  7791. while task.wait() do
  7792. if checkChallenge() == false then --challenge is not cleared
  7793. if getgenv().AutoChallenge and checkReward() == true then
  7794. startChallenge() --start challenge
  7795. else
  7796. FarmCastlePark()--regular farming
  7797. end
  7798. elseif checkChallenge() == true then
  7799. FarmCastlePark()--regular farming
  7800. end
  7801. end
  7802. end))
  7803.  
  7804. if getgenv().AutoLoadTP == true then
  7805. local exec = tostring(identifyexecutor())
  7806.  
  7807. if exec == "Synapse X" then
  7808. syn.queue_on_teleport("loadstring(game:HttpGet('https://raw.githubusercontent.com/Tesseract1234567890/animeadv/main/script.lua'))()")
  7809. RayfieldLib:Notify({
  7810. Title = "Queued to Auto-Attach on Teleport!",
  7811. Content = "Success",
  7812. Duration = 6.5
  7813. })
  7814. else
  7815. queue_on_teleport("loadstring(game:HttpGet('https://raw.githubusercontent.com/Tesseract1234567890/animeadv/main/script.lua'))()")
  7816. end
  7817.  
  7818. end
  7819.  
  7820.  
  7821. --hide name
  7822. task.spawn(function() -- Hides name for yters (not sure if its Fe)
  7823. while task.wait() do
  7824. if getgenv().hidename == true then
  7825. pcall(function()
  7826. if game.Players.LocalPlayer.Character.Head:FindFirstChild("_overhead") then
  7827. workspace[game.Players.LocalPlayer.Name].Head["_overhead"].Enabled = false
  7828. end
  7829. end)
  7830. else
  7831. pcall(function()
  7832. if game.Players.LocalPlayer.Character.Head:FindFirstChild("_overhead") then
  7833. workspace[game.Players.LocalPlayer.Name].Head["_overhead"].Enabled = false
  7834. end
  7835. end)
  7836. end
  7837. end
  7838. end)
  7839.  
  7840.  
  7841. --anti afk
  7842. pcall(function()
  7843. local vu = game:GetService("VirtualUser")
  7844. game:GetService("Players").LocalPlayer.Idled:connect(function()
  7845. vu:Button2Down(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
  7846. wait(1)
  7847. vu:Button2Up(Vector2.new(0,0),workspace.CurrentCamera.CFrame)
  7848. end)
  7849.  
  7850. game:GetService("ReplicatedStorage").endpoints.client_to_server.claim_daily_reward:InvokeServer()
  7851. end)
  7852.  
  7853. if game.PlaceId == 8304191830 then
  7854.  
  7855. pcall(function() ShopSniperWebhook(true) end)
  7856. pcall(function() SpecialSummonSniperWebhook(true) end)
  7857. pcall(function() StandardSummonSniperWebhook(true) end)
  7858.  
  7859.  
  7860. end
  7861.  
  7862. print("Successfully Loaded!!")
  7863. ---------------------------------------------------------------------
Add Comment
Please, Sign In to add comment