DuyOnline101

that one td game recorder

May 28th, 2024
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.89 KB | None | 0 0
  1. local RecVersion = "V2.4"
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage");
  3. local State = ReplicatedStorage.State;
  4. local RS = game:WaitForChild('ReplicatedStorage')
  5. local RSRF = RS:WaitForChild("RemoteFunction")
  6. local RSRE = RS:WaitForChild("RemoteEvent")
  7. getgenv().Towers = {}
  8. getgenv().GoldenPerks = {}
  9. getgenv().Generated = ""
  10. --getgenv().StratName..".txt"
  11. for i,v in pairs(game:GetService("CoreGui"):GetDescendants()) do if v:IsA("Frame") and v.Name == "What do you do?" then v:Remove() end end
  12. for TowerName, Tower in next, game.ReplicatedStorage.RemoteFunction:InvokeServer("Session", "Search", "Inventory.Troops") do
  13. if (Tower.Equipped) then
  14. table.insert(getgenv().Towers, TowerName)
  15. if (Tower.GoldenPerks) then
  16. table.insert(getgenv().GoldenPerks, TowerName)
  17. end
  18. end;
  19. end;
  20. for c=1,5 do if getgenv().Towers[c] == nil then getgenv().Towers[c] = "nil" end end
  21. local gperksl = ""
  22. if getgenv().GoldenPerks[1] then
  23. gperksl = gperksl.."getgenv().GoldenPerks = {"
  24. for i,v in pairs(getgenv().GoldenPerks) do
  25. gperksl = gperksl..'"'..v..'",'
  26. end
  27. gperksl = gperksl.."}\n"
  28. end
  29. if gperksl ~= "" then
  30. getgenv().Generated = getgenv().Generated.."--"..RecVersion.."\n"..gperksl..'local '..getgenv().APIVar..' = loadstring(game:HttpGet("https://raw.githubusercontent.com/Sigmanic/Strategies-X/main/MainSource.lua", true))() \n'..getgenv().APIVar..':Loadout("'..getgenv().Towers[1]..'", "'..getgenv().Towers[2]..'", "'..getgenv().Towers[3]..'", "'..getgenv().Towers[4]..'", "'..getgenv().Towers[5]..'") \n'..getgenv().APIVar..':Map("'..game:GetService("ReplicatedStorage").State.Map.Value..'", true, "'..game:GetService("ReplicatedStorage").State.Mode.Value..'")\n';
  31. else
  32. getgenv().Generated = getgenv().Generated .. "--"..RecVersion.."\n"..'local '..getgenv().APIVar..' = loadstring(game:HttpGet("https://raw.githubusercontent.com/Sigmanic/Strategies-X/main/MainSource.lua", true))() \n'..getgenv().APIVar..':Loadout("'..getgenv().Towers[1]..'", "'..getgenv().Towers[2]..'", "'..getgenv().Towers[3]..'", "'..getgenv().Towers[4]..'", "'..getgenv().Towers[5]..'") \n'..getgenv().APIVar..':Map("'..game:GetService("ReplicatedStorage").State.Map.Value..'", true, "'..game:GetService("ReplicatedStorage").State.Mode.Value..'")\n';
  33. end
  34. function sendw(message)
  35. spawn(function()
  36. if getgenv().Webhook ~= "WEBHOOK (OPTIONAL)" then
  37. local url = getgenv().Webhook
  38. local data = {
  39. ["username"] = "TDS Recorder LOGGER",
  40. ["content"] = message
  41. }
  42. local newdata = game:GetService("HttpService"):JSONEncode(data)
  43. local headers = {
  44. ["content-type"] = "application/json"
  45. }
  46. request = http_request or request or HttpPost or syn.request
  47. local abcdef = {Url = url, Body = newdata, Method = "POST", Headers = headers}
  48. request(abcdef)
  49. print("Webhook sent")
  50. end
  51. end)
  52. end
  53. if getgenv().LoggerWindow then
  54. if game.CoreGui:FindFirstChild("AutoStratsLogger") then
  55. game.CoreGui:FindFirstChild("AutoStratsLogger"):Remove()
  56. end
  57. local LoggerByBanbus = Instance.new("ScreenGui")
  58. local Main = Instance.new("Frame")
  59. local Glow = Instance.new("ImageLabel")
  60. local Top_Container = Instance.new("Frame")
  61. local Title = Instance.new("TextLabel")
  62. local Scroll = Instance.new("ScrollingFrame")
  63.  
  64. LoggerByBanbus.Name = "AutoStratsLogger"
  65. LoggerByBanbus.Parent = game:WaitForChild("CoreGui")
  66. LoggerByBanbus.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  67.  
  68. Main.Name = "Main"
  69. Main.Parent = LoggerByBanbus
  70. Main.BackgroundColor3 = Color3.fromRGB(23, 21, 30)
  71. Main.BorderSizePixel = 0
  72. Main.Position = UDim2.new(0.544935644, 0, 0.355803162, 0)
  73. Main.Size = UDim2.new(0, 500, 0, 400)
  74.  
  75. Glow.Name = "Glow"
  76. Glow.Parent = Main
  77. Glow.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  78. Glow.BackgroundTransparency = 1.000
  79. Glow.BorderSizePixel = 0
  80. Glow.Position = UDim2.new(0, -15, 0, -15)
  81. Glow.Size = UDim2.new(1, 30, 1, 30)
  82. Glow.ZIndex = 0
  83. Glow.Image = "rbxassetid://4996891970"
  84. Glow.ImageColor3 = Color3.fromRGB(15, 15, 15)
  85. Glow.ScaleType = Enum.ScaleType.Slice
  86. Glow.SliceCenter = Rect.new(20, 20, 280, 280)
  87.  
  88. Top_Container.Name = "Top_Container"
  89. Top_Container.Parent = Main
  90. Top_Container.AnchorPoint = Vector2.new(0.5, 0)
  91. Top_Container.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  92. Top_Container.BackgroundTransparency = 1.000
  93. Top_Container.Position = UDim2.new(0.5, 0, 0, 18)
  94. Top_Container.Size = UDim2.new(1, -40, 0, 20)
  95.  
  96. Title.Name = "Title"
  97. Title.Parent = Top_Container
  98. Title.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  99. Title.BackgroundTransparency = 1.000
  100. Title.Position = UDim2.new(0.00764120743, 0, -0.400000006, 0)
  101. Title.Size = UDim2.new(0.981785059, 0, 1.45000005, 0)
  102. Title.Font = Enum.Font.GothamBlack
  103. Title.Text = "AUTOSTRATS LOGGER"
  104. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  105. Title.TextSize = 30.000
  106. Title.TextXAlignment = Enum.TextXAlignment.Left
  107.  
  108. Scroll.Name = "Scroll"
  109. Scroll.Parent = Main
  110. Scroll.Active = true
  111. Scroll.AnchorPoint = Vector2.new(0.5, 0)
  112. Scroll.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  113. Scroll.BackgroundTransparency = 1.000
  114. Scroll.BorderSizePixel = 0
  115. Scroll.Position = UDim2.new(0.5, 4, 0, 59)
  116. Scroll.Size = UDim2.new(1, -20, 1, -67)
  117. Scroll.BottomImage = "rbxassetid://5234388158"
  118. Scroll.CanvasSize = UDim2.new(200, 0, 100, 0)
  119. Scroll.MidImage = "rbxassetid://5234388158"
  120. Scroll.ScrollBarThickness = 8
  121. Scroll.TopImage = "rbxassetid://5234388158"
  122. Scroll.VerticalScrollBarInset = Enum.ScrollBarInset.Always
  123.  
  124. Scroll.ChildAdded:Connect(function()
  125. if #Scroll:GetChildren() > 16 then
  126. Scroll.CanvasPosition = Vector2.new(0,Scroll.CanvasPosition.Y + 20)
  127. end
  128. end)
  129.  
  130. local function drag()
  131. local script = Instance.new('LocalScript', Main)
  132. script.Name = "Dragify"
  133. local UIS = game:GetService("UserInputService")
  134. function dragify(Frame)
  135. dragToggle = nil
  136. dragInput = nil
  137. dragStart = nil
  138. local dragPos = nil
  139. function updateInput(input)
  140. local Delta = input.Position - dragStart
  141. local Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + Delta.X, startPos.Y.Scale, startPos.Y.Offset + Delta.Y)
  142. game:GetService("TweenService"):Create(Frame, TweenInfo.new(0.1), {
  143. Position = Position
  144. }):Play()
  145. end
  146. Frame.InputBegan:Connect(function(input)
  147. if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and UIS:GetFocusedTextBox() == nil then
  148. dragToggle = true
  149. dragStart = input.Position
  150. startPos = Frame.Position
  151. input.Changed:Connect(function()
  152. if input.UserInputState == Enum.UserInputState.End then
  153. dragToggle = false
  154. end
  155. end)
  156. end
  157. end)
  158. Frame.InputChanged:Connect(function(input)
  159. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  160. dragInput = input
  161. end
  162. end)
  163. game:GetService("UserInputService").InputChanged:Connect(function(input)
  164. if input == dragInput and dragToggle then
  165. updateInput(input)
  166. end
  167. end)
  168. end
  169. dragify(script.Parent)
  170. end
  171. drag()
  172. local function positioning()
  173. local script = Instance.new('LocalScript', Main)
  174. script.Name = "Positioning"
  175. script.Parent:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), "Out", "Quad", 1)
  176. script.Parent.Draggable = true
  177. end
  178. positioning()
  179. local prevOutputPos = -0.0073
  180. function TimeConverter(v)
  181. if v <= 9 then
  182. local conv = "0"..v
  183. return conv
  184. else
  185. return v
  186. end
  187. end
  188. getgenv().outputRec = function(msg, color)
  189. local hours = os.date("*t")["hour"]
  190. local mins = os.date("*t")["min"]
  191. local sec = os.date("*t")["sec"]
  192. local colour = Color3.fromRGB(255, 255, 255)
  193. if color then
  194. colour = color
  195. end
  196. local o = Instance.new("TextLabel", Scroll)
  197. o.Text = "["..TimeConverter(hours)..":"..TimeConverter(mins)..":"..TimeConverter(sec).."] "..msg
  198. o.Size = UDim2.new(0.005, 0, 0.001, 0)
  199. o.Position = UDim2.new(0, 0, .007 + prevOutputPos , 0)
  200. o.Font = Enum.Font.SourceSansSemibold
  201. o.TextColor3 = colour
  202. o.TextStrokeTransparency = 0
  203. o.BackgroundTransparency = 1
  204. o.BackgroundColor3 = Color3.new(0, 0, 0)
  205. o.BorderSizePixel = 0
  206. o.BorderColor3 = Color3.new(0, 0, 0)
  207. o.FontSize = "Size14"
  208. o.TextXAlignment = Enum.TextXAlignment.Left
  209. o.ClipsDescendants = true
  210. prevOutputPos = prevOutputPos + 0.0005
  211. end
  212. end
  213. local library = loadstring(game:HttpGet("https://raw.githubusercontent.com/banbuskox/dfhtyxvzexrxgfdzgzfdvfdz/main/jsdnfjdsfdjnsmvkjhlkslzLIB", true))()
  214. if game.PlaceId == 5591597781 then
  215. getgenv().recstatus = "Recording"
  216. if getgenv().LoggerWindow then
  217. getgenv().outputRec("Recording")
  218. end
  219. local function Convert(Seconds)
  220. return math.floor(Seconds / 60), Seconds % 60;
  221. end;
  222. function isgame()
  223. if game.PlaceId == 5591597781 then
  224. return true
  225. else
  226. return false
  227. end
  228. end
  229. stateRep = nil
  230. if isgame() then
  231. function getStateRep() for i,v in pairs(game:GetService("ReplicatedStorage").StateReplicators:GetChildren()) do if v:GetAttribute("TimeScale") then return v end end end
  232. repeat stateRep = getStateRep() until stateRep
  233. end
  234. local cashRep = nil
  235. repeat
  236. for i,v in pairs(game:GetService("ReplicatedStorage").StateReplicators:GetChildren()) do
  237. if v:GetAttribute("UserId") and v:GetAttribute("UserId") == game.Players.LocalPlayer.UserId then
  238. cashRep = v
  239. end
  240. end
  241. until cashRep
  242. function CheckIfUpgrade(troop)
  243. local troopType = troop.Replicator:GetAttribute("Type")
  244. local upgradeNum = troop.Replicator:GetAttribute("Upgrade")
  245. local discountAmount = troop.Replicator:GetAttribute("DiscountBuff")
  246. local troopAssets = game:GetService("ReplicatedStorage").Assets.Troops[troopType]
  247. local nextUpgradePrice = require(troopAssets["Stats"]).Upgrades[upgradeNum+1].Cost
  248. if table.find(getgenv().GoldenPerks, troopType) then
  249. nextUpgradePrice = require(troopAssets["Stats_Golden"]).Upgrades[upgradeNum+1].Cost
  250. end
  251. if game:GetService("ReplicatedStorage").State.Difficulty.Value == "Hardcore" then
  252. nextUpgradePrice = math.floor(nextUpgradePrice*1.5)
  253. end
  254. if tonumber(discountAmount) > 0 then
  255. nextUpgradePrice = math.floor((nextUpgradePrice * (100-tonumber(discountAmount)))/100)
  256. end
  257. if cashRep:GetAttribute("Cash") >= nextUpgradePrice then
  258. return true
  259. else
  260. return false
  261. end
  262. end
  263. function CheckIfPlace(troopType)
  264. local troopAssets = game:GetService("ReplicatedStorage").Assets.Troops[troopType]
  265. local placePrice = require(troopAssets["Stats"]).Price
  266. if table.find(getgenv().GoldenPerks, troopType) then
  267. placePrice = require(troopAssets["Stats_Golden"]).Price
  268. end
  269. if game:GetService("ReplicatedStorage").State.Difficulty.Value == "Hardcore" then
  270. placePrice = math.floor(placePrice*1.5)
  271. end
  272. if cashRep:GetAttribute("Cash") >= placePrice then
  273. return true
  274. else
  275. return false
  276. end
  277. end
  278. local w = library:CreateWindow("Recorder")
  279. w:Section("Last Record :")
  280. w:Section("Recording")
  281. local labelx
  282. for i,v in pairs(game.CoreGui:GetDescendants()) do
  283. if v:IsA("TextLabel") and v.Text == "Recording" then
  284. labelx = v
  285. end
  286. end
  287. w:Section("")
  288. w:Section("TimePassed")
  289. spawn(function()
  290. function TimeConverter(v)
  291. if v <= 9 then
  292. local conv = "0"..v
  293. return conv
  294. else
  295. return v
  296. end
  297. end
  298. local labelx = nil
  299. repeat
  300. for i,v in pairs(game.CoreGui:GetDescendants()) do
  301. if v:IsA("TextLabel") and v.Text == "TimePassed" then
  302. labelx = v
  303. end
  304. end
  305. task.wait()
  306. until labelx
  307. local startTime = os.time()
  308. while task.wait(0.1) do
  309. local t = os.time() - startTime
  310. local seconds = t % 60
  311. local minutes = math.floor(t / 60) % 60
  312. labelx.Text = "Time Passed : "..TimeConverter(minutes)..":"..TimeConverter(seconds)
  313. getgenv().TimePassed = "Time Passed : "..TimeConverter(minutes)..":"..TimeConverter(seconds)
  314. end
  315. end)
  316. w:Section("")
  317. w:Button("Auto Chain (One Time Use)", function()
  318. loadstring(game:HttpGet("https://raw.githubusercontent.com/wxzex/mmsautostratcontinuation/main/autochainv1"))()
  319. end)
  320. w:Button("Auto Chain V2 (Multiple Uses)", function()
  321. if not getgenv().OtherCOAV2 then
  322. loadstring(game:HttpGet("https://raw.githubusercontent.com/wxzex/mmsautostratcontinuation/main/tdsautochainv2"))()
  323. spawn(function()
  324. repeat task.wait() until getgenv().Coms ~= nil
  325. local ReplicatedStorage = game:GetService("ReplicatedStorage");
  326. local State = ReplicatedStorage.State;
  327. local Wave = tonumber(stateRep:GetAttribute("Wave"));
  328. local Timer = State.Timer;
  329. local CurTime = Timer.Time.Value;
  330. local TM, TS = Convert(CurTime);
  331. local HalftTime = false
  332. if Wave ~= 0 and game.Workspace:FindFirstChild("PathArrow") then
  333. HalftTime = true
  334. end
  335. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":AutoChain("..getgenv().Coms[1].Name..", "..getgenv().Coms[2].Name..", "..getgenv().Coms[3].Name..", "..Wave..", "..TM..", "..TS.."."..getgenv().WaveMillisecond..", "..tostring(HalftTime or "false")..")\n";
  336. getgenv().Coms = nil
  337. getgenv().recstatus = "AutoChainV2 Activated"
  338. if getgenv().LoggerWindow then
  339. getgenv().outputRec("AutoChainV2 Activated")
  340. end
  341. end)
  342. else
  343. getgenv().recstatus = "Can't activate AutoChainV2"
  344. if getgenv().LoggerWindow then
  345. getgenv().outputRec("Can't activate AutoChainV2")
  346. end
  347. end
  348. end)
  349. w:Section("\\/ DANGER ZONE \\/")
  350. w:Button("Sell All Farms", function()
  351. for i,v in pairs(game.Workspace.Towers:GetChildren()) do
  352. if getTroopType(v) == "Farm" and v.Owner.Value == game.Players.LocalPlayer.UserId then
  353. RSRF:InvokeServer("Troops","Sell",{["Troop"] = v,["Recorder"] = true})
  354. task.wait()
  355. end
  356. end
  357. local ReplicatedStorage = game:GetService("ReplicatedStorage");
  358. local State = ReplicatedStorage.State;
  359. local Wave = tonumber(stateRep:GetAttribute("Wave"));
  360. local Timer = State.Timer;
  361. local CurTime = Timer.Time.Value;
  362. local TM, TS = Convert(CurTime);
  363. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":SellAllFarms( "..Wave..", "..TM..", "..TS.."."..getgenv().WaveMillisecond..")\n";
  364. end)
  365. w:Section("\\/ SAVE \\/")
  366. w:Button("Save", function()
  367. writefile(getgenv().StratName..".txt", getgenv().Generated)
  368. end)
  369. w:Section("Auto_Save")
  370. spawn(function()
  371. getgenv().AutoSave = 25
  372. while task.wait(1) do
  373. getgenv().AutoSave = getgenv().AutoSave - 1
  374. if getgenv().AutoSave == 0 then
  375. writefile(getgenv().StratName..".txt", getgenv().Generated)
  376. getgenv().AutoSave = 25
  377. end
  378. end
  379. end)
  380. spawn(function()
  381. local labely = nil
  382. repeat
  383. for i,v in pairs(game.CoreGui:GetDescendants()) do
  384. if v:IsA("TextLabel") and v.Text == "Auto_Save" then
  385. labely = v
  386. end
  387. end
  388. task.wait()
  389. until labelx
  390. while task.wait(0.1) do
  391. labely.Text = "Auto Saving in: "..tostring(getgenv().AutoSave)
  392. end
  393. end)
  394. spawn(function()
  395. while task.wait() do
  396. labelx.Text = getgenv().recstatus
  397. end
  398. end)
  399. end
  400.  
  401. spawn(function()
  402. cc = 0
  403. if game.PlaceId == 5591597781 then
  404. game:GetService("Workspace").Towers.ChildAdded:Connect(function(v)
  405. repeat task.wait() until v:FindFirstChild("Owner")
  406. if v.Owner.Value == game.Players.LocalPlayer.UserId then
  407. cc = cc + 1
  408. v.Name = tostring(cc)
  409. end
  410. end)
  411. end
  412. end)
  413.  
  414. function getTroopTypeCheck(troop)
  415. return troop.Replicator:GetAttribute("Type")
  416. end
  417. function getTroopType(tr)
  418. local check = getTroopTypeCheck(tr)
  419. if check then
  420. return check
  421. else
  422. return "Unable to GET"
  423. end
  424. end
  425.  
  426. local function Convert(Seconds)
  427. return math.floor(Seconds / 60), Seconds % 60;
  428. end;
  429.  
  430.  
  431.  
  432. local Towers = {};
  433. local GameTowers = game.Workspace.Towers;
  434.  
  435. spawn(function()
  436. repeat task.wait() until getgenv().RecorderSync
  437. local ReplicatedStorage = game:GetService("ReplicatedStorage");
  438. local State = ReplicatedStorage.State;
  439. local Wave = tonumber(stateRep:GetAttribute("Wave"));
  440. local Timer = State.Timer;
  441. local CurTime = Timer.Time.Value;
  442. local TM, TS = Convert(CurTime);
  443. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":AutoChain("..getgenv().Commanders[1].Name..", "..getgenv().Commanders[2].Name..", "..getgenv().Commanders[3].Name..", "..Wave..", "..TM..", "..TS.."."..getgenv().WaveMillisecond..")\n";
  444. getgenv().recstatus = "Activated AutoChain"
  445. if getgenv().LoggerWindow then
  446. getgenv().outputRec("Activated AutoChain")
  447. end
  448. sendw("Activated AutoChain")
  449. end)
  450.  
  451. getgenv().GoldenPerks = {}
  452. for TowerName, Tower in next, game.ReplicatedStorage.RemoteFunction:InvokeServer("Session", "Search", "Inventory.Troops") do
  453. if (Tower.Equipped) then
  454. if (Tower.GoldenPerks) then
  455. table.insert(getgenv().GoldenPerks, TowerName)
  456. end
  457. end;
  458. end;
  459. function checkIfGolden(Tower)
  460. return table.find(getgenv().GoldenPerks, Tower)
  461. end
  462. local changeThen = 0
  463. game:GetService("ReplicatedStorage").State.Timer.Time:GetPropertyChangedSignal("Value"):Connect(function()
  464. changeThen = changeThen + 1
  465. local changeNow = changeThen
  466. getgenv().WaveMillisecond = 0
  467. for i=1,9 do
  468. if changeThen > changeNow then
  469. break
  470. end
  471. task.wait(0.09)
  472. if changeThen > changeNow then
  473. break
  474. end
  475. getgenv().WaveMillisecond = getgenv().WaveMillisecond + 1
  476. end
  477. end)
  478.  
  479. local function passArgs(args, Msi, Wave, TM, TS, HalftTime, wasDid)
  480. if args[1] == "Troops" then
  481. if args[2] == "Place" then
  482. local PositionData = args[4]
  483. local Tower = args[3]
  484. local Position = PositionData.Position;
  485. if wasDid and type(wasDid) ~= "string" then
  486. if PositionData.Rotation.X > 0 or PositionData.Rotation.Y > 0 or PositionData.Rotation.Z > 0 then
  487. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":Place('"..Tower.."', "..Position.X..", "..Position.Y..", "..Position.Z..", "..Wave..", "..TM..", "..TS.."."..Msi..", true, "..tostring(PositionData.Rotation.X)..", "..tostring(PositionData.Rotation.Y)..", "..tostring(PositionData.Rotation.Z)..", "..tostring(HalftTime or "false")..")\n";
  488. else
  489. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":Place('"..Tower.."', "..Position.X..", "..Position.Y..", "..Position.Z..", "..Wave..", "..TM..", "..TS.."."..Msi..", false, 0, 0, 0, "..tostring(HalftTime or "false")..")\n";
  490. end
  491. getgenv().recstatus = "Placed "..Tower
  492. if getgenv().LoggerWindow then
  493. getgenv().outputRec("Placed "..Tower)
  494. end
  495. sendw("Placed "..Tower)
  496. else
  497. getgenv().recstatus = "Failed To Place "..Tower
  498. if getgenv().LoggerWindow then
  499. getgenv().outputRec("Failed To Place"..Tower)
  500. end
  501. sendw("Failed To Place "..Tower)
  502. end
  503. elseif args[2] == "Sell" then
  504. local Info = args[3]
  505. if not Info.Recorder then
  506. local ReplicatedStorage = game:GetService("ReplicatedStorage");
  507. local Index = Info.Troop.Name
  508. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":Sell("..Index..", "..Wave..", "..TM..", "..TS.."."..Msi..", "..tostring(HalftTime or "false")..")\n";
  509. getgenv().recstatus = "Sold "..Info.Troop.Name
  510. if getgenv().LoggerWindow then
  511. getgenv().outputRec("Sold "..Info.Troop.Name.." ("..getTroopType(Info.Troop)..")")
  512. end
  513. sendw("Sold "..Info.Troop.Name.." ("..getTroopType(Info.Troop)..")")
  514. end
  515. elseif args[2] == "Upgrade" and args[3] == "Set" then
  516. local Troop = args[4]
  517. local Index = Troop.Troop.Name;
  518. repeat task.wait() until Troop.Troop:FindFirstChild("Owner")
  519. if Troop.Troop:FindFirstChild("Owner").Value == game.Players.LocalPlayer.UserId then
  520. if wasDid ~= false then
  521. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":Upgrade("..Index..", "..Wave..", "..TM..", "..TS.."."..Msi..", "..tostring(HalftTime or "false")..")\n";
  522. getgenv().recstatus = "Upgraded "..Troop.Troop.Name
  523. if getgenv().LoggerWindow then
  524. getgenv().outputRec("Upgraded "..Troop.Troop.Name)
  525. end
  526. sendw("Upgraded "..Index.." ("..getTroopType(Troop.Troop)..")")
  527. else
  528. getgenv().recstatus = "Failed To Upgrade "..Troop.Troop.Name
  529. if getgenv().LoggerWindow then
  530. getgenv().outputRec("Failed To Upgrade "..Troop.Troop.Name)
  531. end
  532. sendw("Failed To Upgrade "..Troop.Troop.Name)
  533. end
  534. end
  535. elseif args[2] == "Target" and args[3] == "Set" then
  536. local Troop = args[4]
  537. local Index = Troop.Troop.Name
  538. local Target = Troop.Target
  539. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":Target("..Index..", "..Wave..", \""..Target.."\", "..TM..", "..TS.."."..Msi..", "..tostring(HalftTime or "false")..")\n";
  540. getgenv().recstatus = "Changed Target "..Troop.Troop.Name
  541. if getgenv().LoggerWindow then
  542. getgenv().outputRec("Changed Target "..Troop.Troop.Name.." ("..getTroopType(Troop.Troop)..")")
  543. end
  544. sendw("Changed Target "..Troop.Troop.Name.." ("..getTroopType(Troop.Troop)..")")
  545. elseif args[2] == "Abilities" and args[3] == "Activate" then
  546. local Info = args[4]
  547. local Troop, Ability = Info.Troop, Info.Name;
  548. local Index = Info.Troop.Name
  549. if Info.AutoChain == nil then
  550. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":Ability("..Index..", \""..Ability.."\", "..Wave..", "..TM..", "..TS.."."..Msi..", "..tostring(HalftTime or "false")..")\n";
  551. getgenv().recstatus = "Activated "..Info.Name.." In "..Info.Troop.Name
  552. if getgenv().LoggerWindow then
  553. getgenv().outputRec("Activated "..Info.Name.." In "..Info.Troop.Name)
  554. end
  555. sendw("Activated "..Info.Name.." In "..Info.Troop.Name)
  556. end
  557. end
  558. elseif args[1] == "Voting" and args[2] == "Skip" then
  559. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":Skip("..Wave..", "..TM..", "..TS.."."..Msi..", "..tostring(HalftTime or "false")..")\n";
  560. getgenv().recstatus = "Skipped Wave"
  561. if getgenv().LoggerWindow then
  562. getgenv().outputRec("Skipped Wave")
  563. end
  564. sendw("Skipped Wave")
  565. elseif args[1] == "Difficulty" and args[2] == "Vote" then
  566. local Difficulty = args[3]
  567. local DiffTable = {["Easy"] = "Normal", ["Normal"] = "Molten", ["Insane"] = "Fallen", ["Intermediate"] = "Intermediate"}
  568. if game:GetService("ReplicatedStorage").State.Mode.Value == "Survival" then
  569. getgenv().Generated = getgenv().Generated .. getgenv().APIVar..":Mode('"..Difficulty.."' --[[ !DONT TOUCH! THIS IS CORRECT, IN GAME FILES "..DiffTable[Difficulty].." IS NAMED "..Difficulty.." ]])\n";
  570. getgenv().recstatus = "Voted For Difficulty"
  571. if getgenv().LoggerWindow then
  572. getgenv().outputRec("Voted For Difficulty")
  573. end
  574. sendw("Voted For Difficulty")
  575. end
  576. end
  577. end
  578.  
  579. old = hookmetamethod(game, "__namecall", function(self, ...)
  580. local args = {...}
  581. if getnamecallmethod() == "InvokeServer" and self.name == "RemoteFunction" and not table.find(args, "Rec") then
  582. local thread = coroutine.running()
  583. coroutine.wrap(function(args, stateRep)
  584. local Msi = getgenv().WaveMillisecond
  585. local Wave = tonumber(stateRep:GetAttribute("Wave"))
  586. local function Convert(Seconds) return math.floor(Seconds / 60), Seconds % 60; end
  587. local TM, TS = Convert(game.ReplicatedStorage.State.Timer.Time.Value)
  588. local HalftTime = false
  589. if Wave ~= 0 and game.Workspace:FindFirstChild("PathArrow") then
  590. HalftTime = true
  591. end
  592. table.insert(args, "Rec")
  593. if args[2] == "Place" then
  594. conn = game.Workspace.Towers.ChildAdded:Connect(function(v)
  595. repeat task.wait() until v:FindFirstChild("Replicator")
  596. if v.Owner.Value == game.Players.LocalPlayer.UserId and v.Replicator:GetAttribute("Type") == args[3] then
  597. local selectModule = require(game:GetService("ReplicatedStorage").Client.Modules.Game.Interface.Elements.Upgrade.upgradeHandler)
  598. selectModule.selectTroop(selectModule, v)
  599. conn:Disconnect()
  600. end
  601. end)
  602. end
  603. local wasDid = self.InvokeServer(self, unpack(args))
  604. passArgs(args, Msi, Wave, TM, TS, HalftTime, wasDid)
  605. coroutine.resume(thread,wasDid)
  606. end)(args, stateRep)
  607. return coroutine.yield()
  608. end
  609. return old(self, ...)
  610. end)
Advertisement
Add Comment
Please, Sign In to add comment