8rcj

TD Tower Defense Simulator Script

Oct 16th, 2022 (edited)
5,180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.79 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")
  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")
  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. [1] = "Troops",
  601. [2] = "Place",
  602. [3] = "Accelerator",
  603. [4] = {
  604. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  605. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  606. }
  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. [1] = "Troops",
  615. [2] = "Place",
  616. [3] = "Ace Pilot",
  617. [4] = {
  618. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  619. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  620. }
  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. [1] = "Troops",
  629. [2] = "Place",
  630. [3] = "Archer",
  631. [4] = {
  632. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  633. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  634. }
  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. [1] = "Troops",
  643. [2] = "Place",
  644. [3] = "Commander",
  645. [4] = {
  646. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  647. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  648. }
  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. [1] = "Troops",
  657. [2] = "Place",
  658. [3] = "Cowboy",
  659. [4] = {
  660. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  661. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  662. }
  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. [1] = "Troops",
  671. [2] = "Place",
  672. [3] = "Crook Boss",
  673. [4] = {
  674. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  675. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  676. }
  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. [1] = "Troops",
  685. [2] = "Place",
  686. [3] = "Demoman",
  687. [4] = {
  688. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  689. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  690. }
  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. [1] = "Troops",
  699. [2] = "Place",
  700. [3] = "DJ Booth",
  701. [4] = {
  702. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  703. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  704. }
  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. [1] = "Troops",
  713. [2] = "Place",
  714. [3] = "Electroshocker",
  715. [4] = {
  716. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  717. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  718. }
  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. [1] = "Troops",
  727. [2] = "Place",
  728. [3] = "Engineer",
  729. [4] = {
  730. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  731. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  732. }
  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. [1] = "Troops",
  741. [2] = "Place",
  742. [3] = "Executioner",
  743. [4] = {
  744. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  745. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  746. }
  747. }
  748.  
  749. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  750. end)
  751.  
  752. Stack:NewButton("Farm", "Make sure u stand in the position u want to place", function(txt)
  753. local args = {
  754. [1] = "Troops",
  755. [2] = "Place",
  756. [3] = "Farm",
  757. [4] = {
  758. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  759. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  760. }
  761. }
  762.  
  763. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  764. end)
  765.  
  766. Stack:NewButton("Freezer", "Make sure u stand in the position u want to place", function(txt)
  767. local args = {
  768. [1] = "Troops",
  769. [2] = "Place",
  770. [3] = "Freezer",
  771. [4] = {
  772. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  773. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  774. }
  775. }
  776.  
  777. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  778. end)
  779.  
  780. Stack:NewButton("Hunter", "Make sure u stand in the position u want to place", function(txt)
  781. local args = {
  782. [1] = "Troops",
  783. [2] = "Place",
  784. [3] = "Hunter",
  785. [4] = {
  786. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  787. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  788. }
  789. }
  790.  
  791. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  792. end)
  793.  
  794. Stack:NewButton("Medic", "Make sure u stand in the position u want to place", function(txt)
  795. local args = {
  796. [1] = "Troops",
  797. [2] = "Place",
  798. [3] = "Medic",
  799. [4] = {
  800. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  801. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  802. }
  803. }
  804.  
  805. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  806. end)
  807.  
  808. Stack:NewButton("Militant", "Make sure u stand in the position u want to place", function(txt)
  809. local args = {
  810. [1] = "Troops",
  811. [2] = "Place",
  812. [3] = "Militant",
  813. [4] = {
  814. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  815. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  816. }
  817. }
  818.  
  819. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  820. end)
  821.  
  822. Stack:NewButton("Minigunner", "Make sure u stand in the position u want to place", function(txt)
  823. local args = {
  824. [1] = "Troops",
  825. [2] = "Place",
  826. [3] = "Minigunner",
  827. [4] = {
  828. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  829. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  830. }
  831. }
  832.  
  833. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  834. end)
  835.  
  836. Stack:NewButton("Mortar", "Make sure u stand in the position u want to place", function(txt)
  837. local args = {
  838. [1] = "Troops",
  839. [2] = "Place",
  840. [3] = "Mortar",
  841. [4] = {
  842. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  843. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  844. }
  845. }
  846.  
  847. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  848. end)
  849.  
  850. Stack:NewButton("Paintballer", "Make sure u stand in the position u want to place", function(txt)
  851. local args = {
  852. [1] = "Troops",
  853. [2] = "Place",
  854. [3] = "Paintballer",
  855. [4] = {
  856. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  857. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  858. }
  859. }
  860.  
  861. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  862. end)
  863.  
  864. Stack:NewButton("Pursuit", "Make sure u stand in the position u want to place", function(txt)
  865. local args = {
  866. [1] = "Troops",
  867. [2] = "Place",
  868. [3] = "Pursuit",
  869. [4] = {
  870. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  871. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  872. }
  873. }
  874.  
  875. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  876. end)
  877.  
  878. Stack:NewButton("Pyromancer", "Make sure u stand in the position u want to place", function(txt)
  879. local args = {
  880. [1] = "Troops",
  881. [2] = "Place",
  882. [3] = "Pyromancer",
  883. [4] = {
  884. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  885. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  886. }
  887. }
  888.  
  889. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  890. end)
  891.  
  892. Stack:NewButton("Ranger", "Make sure u stand in the position u want to place", function(txt)
  893. local args = {
  894. [1] = "Troops",
  895. [2] = "Place",
  896. [3] = "Ranger",
  897. [4] = {
  898. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  899. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  900. }
  901. }
  902.  
  903. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  904. end)
  905.  
  906. Stack:NewButton("Rocketeer", "Make sure u stand in the position u want to place", function(txt)
  907. local args = {
  908. [1] = "Troops",
  909. [2] = "Place",
  910. [3] = "Rocketeer",
  911. [4] = {
  912. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  913. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  914. }
  915. }
  916.  
  917. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  918. end)
  919.  
  920. Stack:NewButton("Scout", "Make sure u stand in the position u want to place", function(txt)
  921. local args = {
  922. [1] = "Troops",
  923. [2] = "Place",
  924. [3] = "Scout",
  925. [4] = {
  926. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  927. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  928. }
  929. }
  930.  
  931. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  932. end)
  933.  
  934. Stack:NewButton("Shotgunner", "Make sure u stand in the position u want to place", function(txt)
  935. local args = {
  936. [1] = "Troops",
  937. [2] = "Place",
  938. [3] = "Shotgunner",
  939. [4] = {
  940. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  941. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  942. }
  943. }
  944.  
  945. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  946. end)
  947.  
  948. Stack:NewButton("Sniper", "Make sure u stand in the position u want to place", function(txt)
  949. local args = {
  950. [1] = "Troops",
  951. [2] = "Place",
  952. [3] = "Sniper",
  953. [4] = {
  954. ["Rotation"] = CFrame.new(0,4,0,0,90,0,0,0,0,0,0,0),
  955. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  956. }
  957. }
  958.  
  959. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  960. end)
  961.  
  962. Stack:NewButton("Soldier", "Make sure u stand in the position u want to place", function(txt)
  963. local args = {
  964. [1] = "Troops",
  965. [2] = "Place",
  966. [3] = "Soldier",
  967. [4] = {
  968. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  969. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  970. }
  971. }
  972.  
  973. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  974. end)
  975.  
  976. Stack:NewButton("Toxic Gunner", "Make sure u stand in the position u want to place", function(txt)
  977. local args = {
  978. [1] = "Troops",
  979. [2] = "Place",
  980. [3] = "Toxic Gunner",
  981. [4] = {
  982. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  983. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  984. }
  985. }
  986.  
  987. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  988. end)
  989.  
  990. Stack:NewButton("Turret", "Make sure u stand in the position u want to place", function(txt)
  991. local args = {
  992. [1] = "Troops",
  993. [2] = "Place",
  994. [3] = "Turret",
  995. [4] = {
  996. ["Rotation"] = CFrame.new(0,5,0,0,90,0,0,0,0,0,0,0),
  997. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  998. }
  999. }
  1000.  
  1001. game:GetService("ReplicatedStorage").RemoteFunction:InvokeServer(unpack(args))
  1002. end)
  1003. Stack:NewDropdown("StackTower", "Alt of stack tower name", TowersUHave, function(currentOption)
  1004. local A_1 = "Troops"
  1005. local A_2 = "Place"
  1006. local A_3 = currentOption
  1007. local A_4 =
  1008. {
  1009. ["Rotation"] = CFrame.new(0,5,0),
  1010. ["Position"] = game.Players.LocalPlayer.character.HumanoidRootPart.Position - Vector3.new(0,5,0)
  1011. }
  1012. local Event = game:GetService("ReplicatedStorage").RemoteFunction
  1013. Event:InvokeServer(A_1, A_2, A_3, A_4)
  1014. end)
  1015. local themes = {
  1016. SchemeColor = Color3.fromRGB(255,255,255),
  1017. Background = Color3.fromRGB(255, 255, 255),
  1018. Header = Color3.fromRGB(255, 255, 255),
  1019. TextColor = Color3.fromRGB(255,255,255),
  1020. ElementColor = Color3.fromRGB(255, 255, 255)
  1021. }
  1022. local Lobby = Window:NewTab("Theme")
  1023. local colors = Lobby:NewSection("Colors")
  1024.  
  1025. for theme, color in pairs(themes) do
  1026. colors:NewColorPicker(theme, "Change your "..theme, color, function(color3)
  1027. Library:ChangeColor(theme, color3)
  1028. end)
  1029. end
  1030. local CopyDiscordServerLink = Credits:NewSection("Copy Discord server link")
  1031. CopyDiscordServerLink:NewButton("Copy", "Why don't you even understand this?", function()
  1032. setclipboard("https://discord.gg/8zd9YHAQTF")
  1033. end)
Advertisement
Add Comment
Please, Sign In to add comment