Advertisement
8rcj

TD Tower Defense Simulator Stack script

Apr 5th, 2025
826
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 30.66 KB | None | 0 0
  1. local TowersUHave = {}
  2. for i,v in next, game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer("Session", "Search", "Inventory.Troops") do
  3.     if v.Equipped then
  4.         table.insert(TowersUHave, i)
  5.     end
  6. end
  7. wait(1)
  8. local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/xHeptc/Kavo-UI-Library/main/source.lua"))()
  9. local Window = Library.CreateLib("Essence X", "Serpent")
  10. local Credits = Window:NewTab("Others")
  11. local Lobby = Window:NewTab("Miscellaneous")
  12. local R = Lobby:NewSection("InfZoom")
  13. R:NewButton("InfZoom", "Makes ur zoom basically infinite", function(txt)
  14. game.Players.LocalPlayer.CameraMaxZoomDistance = 1000
  15.     print("Clicked")
  16. end)
  17. local E = Lobby:NewSection("Freecam, SHIFT P")
  18. E:NewButton("Freecam", "Tds Cinematic freecam", function(txt)
  19. --Converted with ttyyuu12345's model to script plugin v4
  20. function sandbox(var,func)
  21. local env = getfenv(func)
  22. local newenv = setmetatable({},{
  23. __index = function(self,k)
  24. if k=="script" then
  25. return var
  26. else
  27. return env[k]
  28. end
  29. end,
  30. })
  31. setfenv(func,newenv)
  32. return func
  33. end
  34. cors = {}
  35. mas = Instance.new("Model",game:GetService("Lighting"))
  36. LocalScript0 = Instance.new("LocalScript")
  37. LocalScript0.Name = "FreeCamera"
  38. LocalScript0.Parent = mas
  39. table.insert(cors,sandbox(LocalScript0,function()
  40. -----------------------------------------------------------------------
  41. -- Freecam
  42. -- Cinematic free camera for spectating and video production.
  43. ------------------------------------------------------------------------
  44.  
  45. local pi    = math.pi
  46. local abs   = math.abs
  47. local clamp = math.clamp
  48. local exp   = math.exp
  49. local rad   = math.rad
  50. local sign  = math.sign
  51. local sqrt  = math.sqrt
  52. local tan   = math.tan
  53.  
  54. local ContextActionService = game:GetService("ContextActionService")
  55. local Players = game:GetService("Players")
  56. local RunService = game:GetService("RunService")
  57. local StarterGui = game:GetService("StarterGui")
  58. local UserInputService = game:GetService("UserInputService")
  59.  
  60. local LocalPlayer = Players.LocalPlayer
  61. if not LocalPlayer then
  62. Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
  63. LocalPlayer = Players.LocalPlayer
  64. end
  65.  
  66. local Camera = workspace.CurrentCamera
  67. workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
  68. local newCamera = workspace.CurrentCamera
  69. if newCamera then
  70. Camera = newCamera
  71. end
  72. end)
  73.  
  74. ------------------------------------------------------------------------
  75.  
  76. local TOGGLE_INPUT_PRIORITY = Enum.ContextActionPriority.Low.Value
  77. local INPUT_PRIORITY = Enum.ContextActionPriority.High.Value
  78. local FREECAM_MACRO_KB = {Enum.KeyCode.LeftShift, Enum.KeyCode.P}
  79.  
  80. local NAV_GAIN = Vector3.new(1, 1, 1)*64
  81. local PAN_GAIN = Vector2.new(0.75, 1)*8
  82. local FOV_GAIN = 300
  83.  
  84. local PITCH_LIMIT = rad(90)
  85.  
  86. local VEL_STIFFNESS = 1.5
  87. local PAN_STIFFNESS = 1.0
  88. local FOV_STIFFNESS = 4.0
  89.  
  90. ------------------------------------------------------------------------
  91.  
  92. local Spring = {} do
  93. Spring.__index = Spring
  94.  
  95. function Spring.new(freq, pos)
  96. local self = setmetatable({}, Spring)
  97. self.f = freq
  98. self.p = pos
  99. self.v = pos*0
  100. return self
  101. end
  102.  
  103. function Spring:Update(dt, goal)
  104. local f = self.f*2*pi
  105. local p0 = self.p
  106. local v0 = self.v
  107.  
  108. local offset = goal - p0
  109. local decay = exp(-f*dt)
  110.  
  111. local p1 = goal + (v0*dt - offset*(f*dt + 1))*decay
  112. local v1 = (f*dt*(offset*f - v0) + v0)*decay
  113.  
  114. self.p = p1
  115. self.v = v1
  116.  
  117. return p1
  118. end
  119.  
  120. function Spring:Reset(pos)
  121. self.p = pos
  122. self.v = pos*0
  123. end
  124. end
  125.  
  126. ------------------------------------------------------------------------
  127.  
  128. local cameraPos = Vector3.new()
  129. local cameraRot = Vector2.new()
  130. local cameraFov = 0
  131.  
  132. local velSpring = Spring.new(VEL_STIFFNESS, Vector3.new())
  133. local panSpring = Spring.new(PAN_STIFFNESS, Vector2.new())
  134. local fovSpring = Spring.new(FOV_STIFFNESS, 0)
  135.  
  136. ------------------------------------------------------------------------
  137.  
  138. local Input = {} do
  139. local thumbstickCurve do
  140. local K_CURVATURE = 2.0
  141. local K_DEADZONE = 0.15
  142.  
  143. local function fCurve(x)
  144. return (exp(K_CURVATURE*x) - 1)/(exp(K_CURVATURE) - 1)
  145. end
  146.  
  147. local function fDeadzone(x)
  148. return fCurve((x - K_DEADZONE)/(1 - K_DEADZONE))
  149. end
  150.  
  151. function thumbstickCurve(x)
  152. return sign(x)*clamp(fDeadzone(abs(x)), 0, 1)
  153. end
  154. end
  155.  
  156. local gamepad = {
  157. ButtonX = 0,
  158. ButtonY = 0,
  159. DPadDown = 0,
  160. DPadUp = 0,
  161. ButtonL2 = 0,
  162. ButtonR2 = 0,
  163. Thumbstick1 = Vector2.new(),
  164. Thumbstick2 = Vector2.new(),
  165. }
  166.  
  167. local keyboard = {
  168. W = 0,
  169. A = 0,
  170. S = 0,
  171. D = 0,
  172. E = 0,
  173. Q = 0,
  174. U = 0,
  175. H = 0,
  176. J = 0,
  177. K = 0,
  178. I = 0,
  179. Y = 0,
  180. Up = 0,
  181. Down = 0,
  182. LeftShift = 0,
  183. RightShift = 0,
  184. }
  185.  
  186. local mouse = {
  187. Delta = Vector2.new(),
  188. MouseWheel = 0,
  189. }
  190.  
  191. local NAV_GAMEPAD_SPEED  = Vector3.new(1, 1, 1)
  192. local NAV_KEYBOARD_SPEED = Vector3.new(1, 1, 1)
  193. local PAN_MOUSE_SPEED    = Vector2.new(1, 1)*(pi/64)
  194. local PAN_GAMEPAD_SPEED  = Vector2.new(1, 1)*(pi/8)
  195. local FOV_WHEEL_SPEED    = 1.0
  196. local FOV_GAMEPAD_SPEED  = 0.25
  197. local NAV_ADJ_SPEED      = 0.75
  198. local NAV_SHIFT_MUL      = 0.25
  199.  
  200. local navSpeed = 1
  201.  
  202. function Input.Vel(dt)
  203. navSpeed = clamp(navSpeed + dt*(keyboard.Up - keyboard.Down)*NAV_ADJ_SPEED, 0.01, 4)
  204.  
  205. local kGamepad = Vector3.new(
  206. thumbstickCurve(gamepad.Thumbstick1.x),
  207. thumbstickCurve(gamepad.ButtonR2) - thumbstickCurve(gamepad.ButtonL2),
  208. thumbstickCurve(-gamepad.Thumbstick1.y)
  209. )*NAV_GAMEPAD_SPEED
  210.  
  211. local kKeyboard = Vector3.new(
  212. keyboard.D - keyboard.A + keyboard.K - keyboard.H,
  213. keyboard.E - keyboard.Q + keyboard.I - keyboard.Y,
  214. keyboard.S - keyboard.W + keyboard.J - keyboard.U
  215. )*NAV_KEYBOARD_SPEED
  216.  
  217. local shift = UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) or UserInputService:IsKeyDown(Enum.KeyCode.RightShift)
  218.  
  219. return (kGamepad + kKeyboard)*(navSpeed*(shift and NAV_SHIFT_MUL or 1))
  220. end
  221.  
  222. function Input.Pan(dt)
  223. local kGamepad = Vector2.new(
  224. thumbstickCurve(gamepad.Thumbstick2.y),
  225. thumbstickCurve(-gamepad.Thumbstick2.x)
  226. )*PAN_GAMEPAD_SPEED
  227. local kMouse = mouse.Delta*PAN_MOUSE_SPEED
  228. mouse.Delta = Vector2.new()
  229. return kGamepad + kMouse
  230. end
  231.  
  232. function Input.Fov(dt)
  233. local kGamepad = (gamepad.ButtonX - gamepad.ButtonY)*FOV_GAMEPAD_SPEED
  234. local kMouse = mouse.MouseWheel*FOV_WHEEL_SPEED
  235. mouse.MouseWheel = 0
  236. return kGamepad + kMouse
  237. end
  238.  
  239. do
  240. local function Keypress(action, state, input)
  241. keyboard[input.KeyCode.Name] = state == Enum.UserInputState.Begin and 1 or 0
  242. return Enum.ContextActionResult.Sink
  243. end
  244.  
  245. local function GpButton(action, state, input)
  246. gamepad[input.KeyCode.Name] = state == Enum.UserInputState.Begin and 1 or 0
  247. return Enum.ContextActionResult.Sink
  248. end
  249.  
  250. local function MousePan(action, state, input)
  251. local delta = input.Delta
  252. mouse.Delta = Vector2.new(-delta.y, -delta.x)
  253. return Enum.ContextActionResult.Sink
  254. end
  255.  
  256. local function Thumb(action, state, input)
  257. gamepad[input.KeyCode.Name] = input.Position
  258. return Enum.ContextActionResult.Sink
  259. end
  260.  
  261. local function Trigger(action, state, input)
  262. gamepad[input.KeyCode.Name] = input.Position.z
  263. return Enum.ContextActionResult.Sink
  264. end
  265.  
  266. local function MouseWheel(action, state, input)
  267. mouse[input.UserInputType.Name] = -input.Position.z
  268. return Enum.ContextActionResult.Sink
  269. end
  270.  
  271. local function Zero(t)
  272. for k, v in pairs(t) do
  273. t[k] = v*0
  274. end
  275. end
  276.  
  277. function Input.StartCapture()
  278. ContextActionService:BindActionAtPriority("FreecamKeyboard", Keypress, false, INPUT_PRIORITY,
  279. Enum.KeyCode.W, Enum.KeyCode.U,
  280. Enum.KeyCode.A, Enum.KeyCode.H,
  281. Enum.KeyCode.S, Enum.KeyCode.J,
  282. Enum.KeyCode.D, Enum.KeyCode.K,
  283. Enum.KeyCode.E, Enum.KeyCode.I,
  284. Enum.KeyCode.Q, Enum.KeyCode.Y,
  285. Enum.KeyCode.Up, Enum.KeyCode.Down
  286. )
  287. ContextActionService:BindActionAtPriority("FreecamMousePan",          MousePan,   false, INPUT_PRIORITY, Enum.UserInputType.MouseMovement)
  288. ContextActionService:BindActionAtPriority("FreecamMouseWheel",        MouseWheel, false, INPUT_PRIORITY, Enum.UserInputType.MouseWheel)
  289. ContextActionService:BindActionAtPriority("FreecamGamepadButton",     GpButton,   false, INPUT_PRIORITY, Enum.KeyCode.ButtonX, Enum.KeyCode.ButtonY)
  290. ContextActionService:BindActionAtPriority("FreecamGamepadTrigger",    Trigger,    false, INPUT_PRIORITY, Enum.KeyCode.ButtonR2, Enum.KeyCode.ButtonL2)
  291. ContextActionService:BindActionAtPriority("FreecamGamepadThumbstick", Thumb,      false, INPUT_PRIORITY, Enum.KeyCode.Thumbstick1, Enum.KeyCode.Thumbstick2)
  292. end
  293.  
  294. function Input.StopCapture()
  295. navSpeed = 1
  296. Zero(gamepad)
  297. Zero(keyboard)
  298. Zero(mouse)
  299. ContextActionService:UnbindAction("FreecamKeyboard")
  300. ContextActionService:UnbindAction("FreecamMousePan")
  301. ContextActionService:UnbindAction("FreecamMouseWheel")
  302. ContextActionService:UnbindAction("FreecamGamepadButton")
  303. ContextActionService:UnbindAction("FreecamGamepadTrigger")
  304. ContextActionService:UnbindAction("FreecamGamepadThumbstick")
  305. end
  306. end
  307. end
  308.  
  309. local function GetFocusDistance(cameraFrame)
  310. local znear = 0.1
  311. local viewport = Camera.ViewportSize
  312. local projy = 2*tan(cameraFov/2)
  313. local projx = viewport.x/viewport.y*projy
  314. local fx = cameraFrame.rightVector
  315. local fy = cameraFrame.upVector
  316. local fz = cameraFrame.lookVector
  317.  
  318. local minVect = Vector3.new()
  319. local minDist = 512
  320.  
  321. for x = 0, 1, 0.5 do
  322. for y = 0, 1, 0.5 do
  323. local cx = (x - 0.5)*projx
  324. local cy = (y - 0.5)*projy
  325. local offset = fx*cx - fy*cy + fz
  326. local origin = cameraFrame.p + offset*znear
  327. local part, hit = workspace:FindPartOnRay(Ray.new(origin, offset.unit*minDist))
  328. local dist = (hit - origin).magnitude
  329. if minDist > dist then
  330. minDist = dist
  331. minVect = offset.unit
  332. end
  333. end
  334. end
  335.  
  336. return fz:Dot(minVect)*minDist
  337. end
  338.  
  339. ------------------------------------------------------------------------
  340.  
  341. local function StepFreecam(dt)
  342. local vel = velSpring:Update(dt, Input.Vel(dt))
  343. local pan = panSpring:Update(dt, Input.Pan(dt))
  344. local fov = fovSpring:Update(dt, Input.Fov(dt))
  345.  
  346. local zoomFactor = sqrt(tan(rad(70/2))/tan(rad(cameraFov/2)))
  347.  
  348. cameraFov = clamp(cameraFov + fov*FOV_GAIN*(dt/zoomFactor), 1, 120)
  349. cameraRot = cameraRot + pan*PAN_GAIN*(dt/zoomFactor)
  350. cameraRot = Vector2.new(clamp(cameraRot.x, -PITCH_LIMIT, PITCH_LIMIT), cameraRot.y%(2*pi))
  351.  
  352. local cameraCFrame = CFrame.new(cameraPos)*CFrame.fromOrientation(cameraRot.x, cameraRot.y, 0)*CFrame.new(vel*NAV_GAIN*dt)
  353. cameraPos = cameraCFrame.p
  354.  
  355. Camera.CFrame = cameraCFrame
  356. Camera.Focus = cameraCFrame*CFrame.new(0, 0, -GetFocusDistance(cameraCFrame))
  357. Camera.FieldOfView = cameraFov
  358. end
  359.  
  360. ------------------------------------------------------------------------
  361.  
  362. local PlayerState = {} do
  363. local mouseIconEnabled
  364. local cameraSubject
  365. local cameraType
  366. local cameraFocus
  367. local cameraCFrame
  368. local cameraFieldOfView
  369. local screenGuis = {}
  370. local coreGuis = {
  371. Backpack = true,
  372. Chat = true,
  373. Health = true,
  374. PlayerList = true,
  375. }
  376. local setCores = {
  377. BadgesNotificationsActive = true,
  378. PointsNotificationsActive = true,
  379. }
  380.  
  381. -- Save state and set up for freecam
  382. function PlayerState.Push()
  383. for name in pairs(coreGuis) do
  384. coreGuis[name] = StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType[name])
  385. StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType[name], false)
  386. end
  387. for name in pairs(setCores) do
  388. setCores[name] = StarterGui:GetCore(name)
  389. StarterGui:SetCore(name, false)
  390. end
  391. local playergui = LocalPlayer:FindFirstChildOfClass("PlayerGui")
  392. if playergui then
  393. for _, gui in pairs(playergui:GetChildren()) do
  394. if gui:IsA("ScreenGui") and gui.Enabled then
  395. screenGuis[#screenGuis + 1] = gui
  396. gui.Enabled = false
  397. end
  398. end
  399. end
  400.  
  401. cameraFieldOfView = Camera.FieldOfView
  402. Camera.FieldOfView = 70
  403.  
  404. cameraType = Camera.CameraType
  405. Camera.CameraType = Enum.CameraType.Custom
  406.  
  407. cameraSubject = Camera.CameraSubject
  408. Camera.CameraSubject = nil
  409.  
  410. cameraCFrame = Camera.CFrame
  411. cameraFocus = Camera.Focus
  412.  
  413. mouseIconEnabled = UserInputService.MouseIconEnabled
  414. UserInputService.MouseIconEnabled = false
  415.  
  416. mouseBehavior = UserInputService.MouseBehavior
  417. UserInputService.MouseBehavior = Enum.MouseBehavior.Default
  418. end
  419.  
  420. -- Restore state
  421. function PlayerState.Pop()
  422. for name, isEnabled in pairs(coreGuis) do
  423. StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType[name], isEnabled)
  424. end
  425. for name, isEnabled in pairs(setCores) do
  426. StarterGui:SetCore(name, isEnabled)
  427. end
  428. for _, gui in pairs(screenGuis) do
  429. if gui.Parent then
  430. gui.Enabled = true
  431. end
  432. end
  433.  
  434. Camera.FieldOfView = cameraFieldOfView
  435. cameraFieldOfView = nil
  436.  
  437. Camera.CameraType = cameraType
  438. cameraType = nil
  439.  
  440. Camera.CameraSubject = cameraSubject
  441. cameraSubject = nil
  442.  
  443. Camera.CFrame = cameraCFrame
  444. cameraCFrame = nil
  445.  
  446. Camera.Focus = cameraFocus
  447. cameraFocus = nil
  448.  
  449. UserInputService.MouseIconEnabled = mouseIconEnabled
  450. mouseIconEnabled = nil
  451.  
  452. UserInputService.MouseBehavior = mouseBehavior
  453. mouseBehavior = nil
  454. end
  455. end
  456.  
  457. local function StartFreecam()
  458. local cameraCFrame = Camera.CFrame
  459. cameraRot = Vector2.new(cameraCFrame:toEulerAnglesYXZ())
  460. cameraPos = cameraCFrame.p
  461. cameraFov = Camera.FieldOfView
  462.  
  463. velSpring:Reset(Vector3.new())
  464. panSpring:Reset(Vector2.new())
  465. fovSpring:Reset(0)
  466.  
  467. PlayerState.Push()
  468. RunService:BindToRenderStep("Freecam", Enum.RenderPriority.Camera.Value, StepFreecam)
  469. Input.StartCapture()
  470. end
  471.  
  472. local function StopFreecam()
  473. Input.StopCapture()
  474. RunService:UnbindFromRenderStep("Freecam")
  475. PlayerState.Pop()
  476. end
  477.  
  478. ------------------------------------------------------------------------
  479.  
  480. do
  481. local enabled = false
  482.  
  483. local function ToggleFreecam()
  484. if enabled then
  485. StopFreecam()
  486. else
  487. StartFreecam()
  488. end
  489. enabled = not enabled
  490. end
  491.  
  492. local function CheckMacro(macro)
  493. for i = 1, #macro - 1 do
  494. if not UserInputService:IsKeyDown(macro[i]) then
  495. return
  496. end
  497. end
  498. ToggleFreecam()
  499. end
  500.  
  501. local function HandleActivationInput(action, state, input)
  502. if state == Enum.UserInputState.Begin then
  503. if input.KeyCode == FREECAM_MACRO_KB[#FREECAM_MACRO_KB] then
  504. CheckMacro(FREECAM_MACRO_KB)
  505. end
  506. end
  507. return Enum.ContextActionResult.Pass
  508. end
  509.  
  510. ContextActionService:BindActionAtPriority("FreecamToggle", HandleActivationInput, false, TOGGLE_INPUT_PRIORITY, FREECAM_MACRO_KB[#FREECAM_MACRO_KB])
  511. end
  512. end))
  513. for i,v in pairs(mas:GetChildren()) do
  514. v.Parent = game:GetService("Players").LocalPlayer.PlayerGui
  515. pcall(function() v:MakeJoints() end)
  516. end
  517. mas:Destroy()
  518. for i,v in pairs(cors) do
  519. spawn(function()
  520. pcall(v)
  521. end)
  522. end
  523.     print("Clicked")
  524. end)
  525. local Hotkeys = Lobby:NewSection("Hotkey Script")
  526. Hotkeys:NewButton("Hotkeys", "original script by MintTea", function(txt)
  527. local lib = loadstring(game:HttpGet("https://raw.githubusercontent.com/banbuskox/dfhtyxvzexrxgfdzgzfdvfdz/main/jsdnfjdsfdjnsmvkjhlkslzLIB", true))()
  528. local w = lib:CreateWindow("Hotkeys")
  529. w:Section("RCtrl To Close UI:")
  530. w:Section("e = Upgrade:")
  531. w:Section("r = Sell:")
  532. w:Section("z = COA:")
  533. w:Section("x = Warrior's Call:")
  534. w:Section("c = Cleansing:")
  535. w:Section("v = Swarm:")
  536. local m = game.Players.LocalPlayer:GetMouse()
  537. function findModel(part)
  538.     while true do
  539.         local parentModel = part:FindFirstAncestorOfClass("Model")
  540.         if not parentModel then
  541.             return nil
  542.         end
  543.         if parentModel.Parent == workspace.Towers then
  544.             return parentModel
  545.         else
  546.             part = parentModel
  547.         end
  548.     end
  549. end
  550. m.KeyDown:Connect(function(key)
  551.     local tar = m.Target
  552.     local tower = findModel(tar)
  553.     if tower then
  554.     if key:lower() == "e" then
  555.      game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer("Troops","Upgrade","Set",{["Troop"] = tower})
  556.     elseif key:lower() == "r" then
  557.         game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer("Troops","Sell",{["Troop"] = tower})
  558.     elseif key:lower() == "z" then
  559.         game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer("Troops","Abilities","Activate",{["Name"] = "Call Of Arms",["Troop"] = tower})
  560.     elseif key:lower() == "x" then
  561.         game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer("Troops","Abilities","Activate",{["Name"] = "Warrior's Call",["Troop"] = tower})
  562.     elseif key:lower() == "c" then
  563.         game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer("Troops","Abilities","Activate",{["Name"] = "Cleansing",["Troop"] = tower})
  564.     elseif key:lower() == "v" then
  565.         game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer("Troops","Abilities","Activate",{["Name"] = "Swarm",["Troop"] = tower})
  566.     end
  567.     end
  568. end)
  569.     print("Clicked")
  570. end)
  571. local Autochain = Lobby:NewSection("Autochain patched")
  572. Autochain:NewButton("Autochain", "Loads autochain script by MM", function(txt)
  573. loadstring(game:HttpGet("https://banbus.cf/scripts/tdsautochainv2"))()
  574.     print("Clicked")
  575. end)
  576. local Nicuse = Lobby:NewSection("Nicuse Hub GONE")
  577. Nicuse:NewButton("Nicuse Hub", "Loads Nicuse's Hub", function(txt)
  578. loadstring(game:HttpGet('https://raw.githubusercontent.com/Nicuse/RobloxScripts/main/TowerDefenseSimulator.lua', true))()
  579.     print("Clicked")
  580. end)
  581. local ToggleUI = Lobby:NewSection("Toggle UI")
  582. ToggleUI:NewKeybind("Toggle UI", "Toggles the UI", Enum.KeyCode.LeftControl, function(txt)
  583.     Library:ToggleUI()
  584. end)
  585. local Lobby = Window:NewTab("Game")
  586. local turn = false
  587. local CreditsBar = Credits:NewSection("Credits")
  588. CreditsBar:NewLabel("TripleDomm: Owner script")
  589. CreditsBar:NewLabel("jonasasJB, Sinon, rear : Homies")
  590. local Skip = Lobby:NewSection("Skip")
  591. Skip:NewKeybind("Skip", "Skips Wave", Enum.KeyCode.F, function(txt)
  592. local A_1 = "Waves"
  593. local A_2 = "Skip"
  594. local Event = game:GetService("ReplicatedStorage").RemoteFunction
  595. Event:InvokeServer(A_1, A_2)
  596. end)
  597. local Stack = Lobby:NewSection("Stack")
  598. Stack:NewButton("Accelerator", "Make sure u stand in the position u want to place", function(txt)
  599.     local args = {
  600.         "Troops",
  601.         "Place",
  602.         {
  603.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  604.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  605.         },
  606.         "Accelerator"
  607.     }
  608.  
  609.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  610. end)
  611.  
  612. Stack:NewButton("Ace Pilot", "Make sure u stand in the position u want to place", function(txt)
  613.     local args = {
  614.         "Troops",
  615.         "Place",
  616.         {
  617.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  618.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  619.         },
  620.         "Ace Pilot"
  621.     }
  622.  
  623.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  624. end)
  625.  
  626. Stack:NewButton("Archer", "Make sure u stand in the position u want to place", function(txt)
  627.     local args = {
  628.         "Troops",
  629.         "Place",
  630.         {
  631.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  632.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  633.         },
  634.         "Archer"
  635.     }
  636.  
  637.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  638. end)
  639.  
  640. Stack:NewButton("Commander", "Make sure u stand in the position u want to place", function(txt)
  641.     local args = {
  642.         "Troops",
  643.         "Place",
  644.         {
  645.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  646.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  647.         },
  648.         "Commander"
  649.     }
  650.  
  651.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  652. end)
  653.  
  654. Stack:NewButton("Cowboy", "Make sure u stand in the position u want to place", function(txt)
  655.     local args = {
  656.         "Troops",
  657.         "Place",
  658.         {
  659.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  660.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  661.         },
  662.         "Cowboy"
  663.     }
  664.  
  665.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  666. end)
  667.  
  668. Stack:NewButton("Crook Boss", "Make sure u stand in the position u want to place", function(txt)
  669.     local args = {
  670.         "Troops",
  671.         "Place",
  672.         {
  673.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  674.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  675.         },
  676.         "Crook Boss"
  677.     }
  678.  
  679.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  680. end)
  681.  
  682. Stack:NewButton("Demoman", "Make sure u stand in the position u want to place", function(txt)
  683.     local args = {
  684.         "Troops",
  685.         "Place",
  686.         {
  687.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  688.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  689.         },
  690.         "Demoman"
  691.     }
  692.  
  693.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  694. end)
  695.  
  696. Stack:NewButton("DJ Booth", "Make sure u stand in the position u want to place", function(txt)
  697.     local args = {
  698.         "Troops",
  699.         "Place",
  700.         {
  701.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  702.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  703.         },
  704.         "DJ Booth"
  705.     }
  706.  
  707.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  708. end)
  709.  
  710. Stack:NewButton("Electroshocker", "Make sure u stand in the position u want to place", function(txt)
  711.     local args = {
  712.         "Troops",
  713.         "Place",
  714.         {
  715.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  716.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  717.         },
  718.         "Electroshocker"
  719.     }
  720.  
  721.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  722. end)
  723.  
  724. Stack:NewButton("Engineer", "Make sure u stand in the position u want to place", function(txt)
  725.     local args = {
  726.         "Troops",
  727.         "Place",
  728.         {
  729.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  730.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  731.         },
  732.         "Engineer"
  733.     }
  734.  
  735.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  736. end)
  737.  
  738. Stack:NewButton("Executioner", "Make sure u stand in the position u want to place", function(txt)
  739.     local args = {
  740.         "Troops",
  741.         "Place",
  742.         {
  743.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  744.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  745.         },
  746.         "Executioner"
  747.     }
  748.  
  749.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  750. end)
  751. Stack:NewButton("Farm", "Make sure u stand in the position u want to place", function(txt)
  752.     local args = {
  753.         "Troops",
  754.         "Place",
  755.         {
  756.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  757.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  758.         },
  759.         "Farm"
  760.     }
  761.  
  762.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  763. end)
  764.  
  765. Stack:NewButton("Freezer", "Make sure u stand in the position u want to place", function(txt)
  766.     local args = {
  767.         "Troops",
  768.         "Place",
  769.         {
  770.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  771.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  772.         },
  773.         "Freezer"
  774.     }
  775.  
  776.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  777. end)
  778.  
  779. Stack:NewButton("Hunter", "Make sure u stand in the position u want to place", function(txt)
  780.     local args = {
  781.         "Troops",
  782.         "Place",
  783.         {
  784.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  785.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  786.         },
  787.         "Hunter"
  788.     }
  789.  
  790.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  791. end)
  792.  
  793. Stack:NewButton("Medic", "Make sure u stand in the position u want to place", function(txt)
  794.     local args = {
  795.         "Troops",
  796.         "Place",
  797.         {
  798.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  799.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  800.         },
  801.         "Medic"
  802.     }
  803.  
  804.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  805. end)
  806.  
  807. Stack:NewButton("Militant", "Make sure u stand in the position u want to place", function(txt)
  808.     local args = {
  809.         "Troops",
  810.         "Place",
  811.         {
  812.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  813.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  814.         },
  815.         "Militant"
  816.     }
  817.  
  818.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  819. end)
  820.  
  821. Stack:NewButton("Minigunner", "Make sure u stand in the position u want to place", function(txt)
  822.     local args = {
  823.         "Troops",
  824.         "Place",
  825.         {
  826.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  827.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  828.         },
  829.         "Minigunner"
  830.     }
  831.  
  832.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  833. end)
  834.  
  835. Stack:NewButton("Mortar", "Make sure u stand in the position u want to place", function(txt)
  836.     local args = {
  837.         "Troops",
  838.         "Place",
  839.         {
  840.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  841.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  842.         },
  843.         "Mortar"
  844.     }
  845.  
  846.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  847. end)
  848.  
  849. Stack:NewButton("Paintballer", "Make sure u stand in the position u want to place", function(txt)
  850.     local args = {
  851.         "Troops",
  852.         "Place",
  853.         {
  854.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  855.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  856.         },
  857.         "Paintballer"
  858.     }
  859.  
  860.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  861. end)
  862.  
  863. Stack:NewButton("Pursuit", "Make sure u stand in the position u want to place", function(txt)
  864.     local args = {
  865.         "Troops",
  866.         "Place",
  867.         {
  868.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  869.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  870.         },
  871.         "Pursuit"
  872.     }
  873.  
  874.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  875. end)
  876.  
  877. Stack:NewButton("Pyromancer", "Make sure u stand in the position u want to place", function(txt)
  878.     local args = {
  879.         "Troops",
  880.         "Place",
  881.         {
  882.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  883.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  884.         },
  885.         "Pyromancer"
  886.     }
  887.  
  888.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  889. end)
  890.  
  891. Stack:NewButton("Ranger", "Make sure u stand in the position u want to place", function(txt)
  892.     local args = {
  893.         "Troops",
  894.         "Place",
  895.         {
  896.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  897.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  898.         },
  899.         "Ranger"
  900.     }
  901.  
  902.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  903. end)
  904.  
  905. Stack:NewButton("Rocketeer", "Make sure u stand in the position u want to place", function(txt)
  906.     local args = {
  907.         "Troops",
  908.         "Place",
  909.         {
  910.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  911.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  912.         },
  913.         "Rocketeer"
  914.     }
  915.  
  916.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  917. end)
  918.  
  919. Stack:NewButton("Scout", "Make sure u stand in the position u want to place", function(txt)
  920.     local args = {
  921.         "Troops",
  922.         "Place",
  923.         {
  924.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  925.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  926.         },
  927.         "Scout"
  928.     }
  929.  
  930.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  931. end)
  932.  
  933. Stack:NewButton("Scout2", "Only works on some maps", function()
  934.     local player = game.Players.LocalPlayer
  935.     local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
  936.     if not hrp then return end
  937.  
  938.     local args = {
  939.         "Troops",
  940.         "Place",
  941.         {
  942.             Position = hrp.Position - Vector3.new(0, 0, 0),
  943.             Rotation = CFrame.Angles(math.rad(90), 0, 0)
  944.         },
  945.         "Scout"
  946.     }
  947.  
  948.     local RemoteFunction = game:GetService("ReplicatedStorage"):WaitForChild("RemoteFunction")
  949.     RemoteFunction:InvokeServer(unpack(args))
  950. end)
  951.  
  952. Stack:NewButton("Shotgunner", "Make sure u stand in the position u want to place", function(txt)
  953.     local args = {
  954.         "Troops",
  955.         "Place",
  956.         {
  957.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  958.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  959.         },
  960.         "Shotgunner"
  961.     }
  962.  
  963.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  964. end)
  965.  
  966. Stack:NewButton("Sniper", "Make sure u stand in the position u want to place", function(txt)
  967.     local args = {
  968.         "Troops",
  969.         "Place",
  970.         {
  971.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  972.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  973.         },
  974.         "Sniper"
  975.     }
  976.  
  977.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  978. end)
  979.  
  980. Stack:NewButton("Soldier", "Make sure u stand in the position u want to place", function(txt)
  981.     local args = {
  982.         "Troops",
  983.         "Place",
  984.         {
  985.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  986.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  987.         },
  988.         "Soldier"
  989.     }
  990.  
  991.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  992. end)
  993.  
  994. Stack:NewButton("Toxic Gunner", "Make sure u stand in the position u want to place", function(txt)
  995.     local args = {
  996.         "Troops",
  997.         "Place",
  998.         {
  999.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  1000.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  1001.         },
  1002.         "Toxic Gunner"
  1003.     }
  1004.  
  1005.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  1006. end)
  1007.  
  1008. Stack:NewButton("Turret", "Make sure u stand in the position u want to place", function(txt)
  1009.     local args = {
  1010.         "Troops",
  1011.         "Place",
  1012.         {
  1013.             ["Rotation"] = CFrame.Angles(math.rad(90), 0, 0),
  1014.             ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  1015.         },
  1016.         "Turret"
  1017.     }
  1018.  
  1019.     game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  1020. end)
  1021. Stack:NewDropdown("StackTower", "Alt of stack tower name", TowersUHave, function(currentOption)
  1022.     local A_1 = "Troops"
  1023.         local A_2 = "Place"
  1024.         local A_3 = currentOption
  1025.         local A_4 =
  1026.             {
  1027.                 ["Rotation"] = CFrame.new(0,5,0),
  1028.                 ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,-5,0)
  1029.             }
  1030.         local Event = game:GetService("ReplicatedStorage").RemoteFunction
  1031.         Event:InvokeServer(A_1, A_2, A_3, A_4)
  1032. end)
  1033. local themes = {
  1034.     SchemeColor = Color3.fromRGB(255,255,255),
  1035.     Background = Color3.fromRGB(255, 255, 255),
  1036.     Header = Color3.fromRGB(255, 255, 255),
  1037.     TextColor = Color3.fromRGB(255,255,255),
  1038.     ElementColor = Color3.fromRGB(255, 255, 255)
  1039. }
  1040. local Lobby = Window:NewTab("Theme")
  1041. local colors = Lobby:NewSection("Colors")
  1042.  
  1043. for theme, color in pairs(themes) do
  1044.     colors:NewColorPicker(theme, "Change your "..theme, color, function(color3)
  1045.         Library:ChangeColor(theme, color3)
  1046.     end)
  1047. end
  1048. local CopyDiscordServerLink = Credits:NewSection("Copy Discord server link")
  1049. CopyDiscordServerLink:NewButton("Copy", "Why don't you even understand this?", function()
  1050.     setclipboard("https://discord.gg/8zd9YHAQTF")
  1051. end)
Advertisement
Comments
  • 8rcj
    74 days
    # text 0.13 KB | 0 0
    1. Recode of my old 2022 script, people said it was patched so I decided to fix it. I have other versions, but I guess this is all for now
Add Comment
Please, Sign In to add comment
Advertisement