BenjiKad

Untitled

Apr 24th, 2025
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.22 KB | None | 0 0
  1. --[[bots]]
  2. --[[todo:
  3. general bug fixes:
  4. websocket not closing / disconnecting (1/2 fixed, just changed order)
  5. players with numbers actually get called when typing a player ("123" should get 123player but it used to be nil, not anymore)
  6.  
  7. add:
  8.  
  9. animate (works)
  10. cemote custom emote (choose from a list)
  11. march / marchto (follow but with extra steps)
  12. cloneanimation (1/2 works)
  13. snake
  14.  
  15. mech (its done, just not added)
  16.  
  17. cmds:
  18. line, to, goto
  19. cmere
  20. e, emote, dance
  21. return
  22. setting, setsetting
  23. lookat
  24. skiddie
  25. credits, owner
  26. firework, antiair, aa
  27. explode, boom
  28. version
  29. identifysystem, name
  30. antiafk, antiidle
  31. close
  32. reset
  33. walkto, follow, chase (un)
  34. bng (un)
  35. orbit (un)
  36. spin (un)
  37. spook, crazy, scare (un)
  38. sit (un)
  39. run, ls, loadstring
  40. chat
  41. cinfo, cmdinfo, commandinfo
  42. stats
  43. speakorder, order
  44. setfpscap, fpscap
  45. circle
  46. bot (.bot # cmd args)
  47. stack, hat (un)
  48. ]]
  49.  
  50. local owner = 'XxAsherBlockxX'--thedenteda
  51. local port = 8081 --8080
  52.  
  53. local leaders = {
  54. 'thedenteda',
  55. 'ThatSillyGuyFromEat',
  56. 'Stoomie',
  57. 'RampageCeremony',
  58. 'Mrgesmask',
  59. 'napalm_416',
  60. 'September6plus5',
  61. '394_9',
  62. 'pg_gamer909',
  63. 'XxAsherBlockxX',
  64. -- ''
  65. }
  66.  
  67. local bots = {
  68. 'thedentedb',
  69. 'thedentedc',
  70. 'thedentedd',
  71. 'thedentede',
  72. 'thedentedf',
  73. 'thedentedg',
  74. 'dudeman123qwe123',
  75. }
  76.  
  77. local prefix = '.'
  78. local lineOffset = 0
  79.  
  80. local TCS = game:GetService("TextChatService")
  81. local TS = game:GetService('TweenService')
  82. local plrs = game:GetService('Players')
  83. local lp = plrs.LocalPlayer
  84. local isLegacyChat = TCS.ChatVersion == Enum.ChatVersion.LegacyChatService
  85. local COBRA_Active = true
  86.  
  87. local letters = {
  88. ['a'] = 1,
  89. ['b'] = 2,
  90. ['c'] = 3,
  91. ['d'] = 4,
  92. ['e'] = 5,
  93. ['f'] = 6,
  94. ['g'] = 7,
  95. ['h'] = 8,
  96. ['i'] = 9,
  97. ['j'] = 10,
  98. ['k'] = 11,
  99. ['l'] = 12,
  100. ['m'] = 13,
  101. ['n'] = 14,
  102. ['o'] = 15,
  103. ['p'] = 16,
  104. ['q'] = 17,
  105. ['r'] = 18,
  106. ['s'] = 19,
  107. ['t'] = 20,
  108. ['u'] = 21,
  109. ['v'] = 22,
  110. ['w'] = 23,
  111. ['x'] = 24,
  112. ['y'] = 25,
  113. ['z'] = 26,
  114. }
  115.  
  116. local cversion = 'v.1.84'
  117. local queueteleport = (syn and syn.queue_on_teleport) or queue_on_teleport or (fluxus and fluxus.queue_on_teleport)
  118.  
  119. local canprint = identifyexecutor() == 'Wave'
  120.  
  121. if canprint then
  122. rconsoleclear()
  123. wait(.1)
  124. end
  125.  
  126. local s,e = pcall(function()
  127. local reset = true
  128.  
  129. if getgenv().botsystem and getgenv().botsystem.reset == false then
  130. for i, v in getgenv().botsystem.connections do
  131. pcall(function() v:Disconnect() end)
  132. end
  133. for i, v in getgenv().botsystem.todestroy do
  134. pcall(function() v:Destroy() end)
  135. end
  136. getgenv().botsystem.current += 1
  137. if getgenv().botsystem.newscriptloaded then
  138. getgenv().botsystem.newscriptloaded:Fire()
  139. else
  140. getgenv().botsystem.newscriptloaded = Instance.new('BindableEvent',game:GetService('PolicyService'))
  141. end
  142.  
  143. pcall(function()
  144. getgenv().botsystem.websocket:Close()
  145. end)
  146.  
  147. reset = false
  148. end
  149.  
  150. if getgenv().botsystem and getgenv().botsystem.version ~= cversion then reset = true end
  151.  
  152. if reset == true then
  153. local antiidle = false
  154.  
  155. if getgenv().botsystem and getgenv().botsystem.antiidle ~= nil then
  156. antiidle = getgenv().botsystem.antiidle
  157. end
  158.  
  159. getgenv().botsystem = {
  160. ['connections'] = {},
  161. ['todestroy'] = {},
  162. ['current'] = 1,
  163. ['version'] = cversion,
  164. ['name'] = 'COBRA',
  165. ['longname'] = 'Collective Operational Bot Resource Architecture',
  166. ['newscriptloaded'] = nil,
  167. ['websocket'] = nil,
  168. ['chatsystem'] = {},
  169. ['reset'] = false,
  170. ['antiidle'] = antiidle,
  171. }
  172.  
  173. if getgenv().botsystem.newscriptloaded then
  174. getgenv().botsystem.newscriptloaded:Fire()
  175. else
  176. getgenv().botsystem.newscriptloaded = Instance.new('BindableEvent',game:GetService('PolicyService'))
  177. end
  178.  
  179. if getgenv().botsystem.chatsystem == nil or #getgenv().botsystem.chatsystem == 0 then
  180. getgenv().botsystem.chatsystem['agree'] = Instance.new('BindableEvent',game:GetService('PolicyService'))
  181. getgenv().botsystem.chatsystem['disagree'] = Instance.new('BindableEvent',game:GetService('PolicyService'))
  182. end
  183. end
  184.  
  185. end)
  186.  
  187. local commands = {}
  188. local stack = {}
  189.  
  190. local function chatMessage(str)
  191. str = tostring(str)
  192.  
  193. table.insert(stack, str)
  194.  
  195. repeat
  196. task.wait()
  197. until stack[1] == str
  198.  
  199. if not isLegacyChat then
  200. TCS.TextChannels.RBXGeneral:SendAsync(str)
  201. else
  202. game:GetService('ReplicatedStorage').DefaultChatSystemChatEvents.SayMessageRequest:FireServer(str, "All")
  203. end
  204.  
  205. task.wait(.5)
  206.  
  207. table.remove(stack, 1)
  208. end
  209.  
  210. if getgenv().botsystem == nil or s == false then
  211. chatMessage('COBRA BOOT FAILURE!')
  212. error(e)
  213. end
  214.  
  215. local cinfo = {}
  216. for i,v in getgenv().botsystem do
  217. cinfo[i] = v
  218. end
  219.  
  220. local justRestricted = {
  221. [1] = false,
  222. [2] = 0,
  223. }
  224.  
  225. local function isOwner(plr)
  226. local v = plr.Name == owner
  227.  
  228. if justRestricted[1] and tick() - justRestricted[2] < 10 then
  229. if not v then
  230. justRestricted[1] = true
  231. justRestricted[2] = tick()
  232. end
  233. return v
  234. end
  235.  
  236. if not v then
  237. justRestricted[1] = true
  238. justRestricted[2] = tick()
  239. chatMessage('COBRA // Access denied.')
  240. end
  241. return v
  242. end
  243.  
  244. local function hasWS()
  245. return getgenv().botsystem.websocket ~= nil
  246. end
  247.  
  248. function getRoot(char)
  249. local rootPart = char:FindFirstChild('HumanoidRootPart') or char:FindFirstChild('Torso') or char:FindFirstChild('UpperTorso')
  250. return rootPart
  251. end
  252.  
  253. local function getCommand(name)
  254. if name:gsub(' ', '') == '' then return false end
  255. if name:gsub(' ', ''):sub(1,1) == '.' then return false end
  256. for i, v in commands do
  257. if table.find(v.names, name) then
  258. return v
  259. end
  260. end
  261. end
  262.  
  263. local function runCommand(from, name, args, extra)
  264. local cmd = getCommand(name)
  265. if cmd then
  266. cmd['function'](from, args, extra)
  267. elseif cmd ~= false then
  268. chatMessage('No command found.')
  269. end
  270. end
  271.  
  272. local function r15(plr)
  273. if plr.Character:FindFirstChildOfClass('Humanoid').RigType == Enum.HumanoidRigType.R15 then
  274. return true
  275. end
  276. end
  277.  
  278. if not s then
  279. chatMessage('Setup error detected. Check logs.')
  280. warn(e)
  281. error('Setup error!')
  282. end
  283.  
  284. local funcs = {}
  285.  
  286. function funcs.get(prop,info,where,all)
  287. info = tostring(info)
  288. if not all then
  289. for i,v in where:GetChildren() do
  290. if tostring(v[prop]):lower():sub(1,info:len()) == info:lower() then
  291. return v
  292. end
  293. end
  294. else
  295. for i,v in where:GetDescendants() do
  296. if tostring(v[prop]):lower():sub(1,info:len()) == info:lower() then
  297. return v
  298. end
  299. end
  300. end
  301. end
  302.  
  303. function funcs.getPlayer(nameOrId)
  304. local isId = false
  305.  
  306. -- if tonumber(nameOrId) ~= nil then
  307. -- isId = true
  308. -- end
  309.  
  310. if not isId then
  311. return funcs.get('Name',tostring(nameOrId),game.Players,false) or funcs.get('DisplayName',tostring(nameOrId),game.Players,false)
  312. else
  313. local out = funcs.get('UserId',tonumber(nameOrId),game.Players,false)
  314. if out == nil then
  315. out = funcs.get('Name',tostring(nameOrId),game.Players,false) or funcs.get('DisplayName',tostring(nameOrId),game.Players,false)
  316. end
  317. return out
  318. end
  319. end
  320.  
  321. local function playerMetric(whoRan,input)
  322. local input = input:lower()
  323. if whoRan then
  324. if input == 'me' then return {whoRan} end
  325. if input == 'others' then
  326. local d = game.Players:GetPlayers()
  327. for i,v in d do
  328. if v == whoRan then
  329. table.remove(d,i)
  330. end
  331. end
  332. return d
  333. end
  334. end
  335.  
  336. if input == 'all' then return game.Players:GetPlayers() end
  337. if input == 'random' then
  338. local a = plrs:GetPlayers()
  339. for i,v in a do
  340. if table.find(bots,v.Name) or table.find(leaders,v.Name) then
  341. table.remove(a,i)
  342. end
  343. end
  344. local b = #a return {a[math.random(1,b)]}
  345. end
  346. end
  347.  
  348. function funcs.getPlayerUsingMetrics(whoRan,input)
  349. if type(input) == 'table' then
  350. local list = {}
  351. for i,v in input do
  352. local isMetric = playerMetric(whoRan,v)
  353. if isMetric then
  354. table.insert(list, isMetric)
  355. else
  356. local isPlr = funcs.getPlayer(v)
  357. if isPlr then
  358. table.insert(list, funcs.getPlayer(v))
  359. end
  360. end
  361. end
  362.  
  363. local pm = startCleanForDupes(list)
  364.  
  365. if pm then
  366. return pm
  367. else
  368. local list = {}
  369. for i,v in input do
  370. table.insert(list, funcs.getPlayer(v))
  371. end
  372.  
  373. return startCleanForDupes(list) or nil
  374. end
  375.  
  376. elseif type(input) == 'string' then
  377. local pm = playerMetric(whoRan,input)
  378.  
  379. if pm then
  380. return pm
  381. else
  382. return {funcs.getPlayer(input)} or nil
  383. end
  384. end
  385. end
  386.  
  387. local function getOnlineBots()
  388. local activeBots = {}
  389.  
  390. for _, bot in ipairs(bots) do
  391. for _, player in ipairs(plrs:GetPlayers()) do
  392. if player.Name == bot then
  393. table.insert(activeBots, bot)
  394. end
  395. end
  396. end
  397.  
  398. return activeBots
  399. end
  400.  
  401. local function getOrder(name)
  402.  
  403. if name == nil then warn('ORDER // No name given. :: Used LocalPlayer.') name = lp.Name end
  404.  
  405. if table.find(bots, name) then
  406. local activeBots = getOnlineBots()
  407.  
  408. for i, bot in ipairs(activeBots) do
  409. if bot == name then
  410. return i
  411. end
  412. end
  413. end
  414.  
  415. if tonumber(name:sub(#name, #name)) then
  416. return tonumber(name:sub(#name, #name))
  417. elseif letters[name:sub(#name, #name)] then
  418. return letters[name:sub(#name, #name)]
  419. end
  420. end
  421.  
  422. local function numberLister(inp)
  423. local got = {}
  424.  
  425. for part in inp:gmatch("[^,]+") do
  426. if part:find(":") then
  427. local range_start, range_end = part:match("(%d+):(%d+)")
  428. range_start, range_end = tonumber(range_start), tonumber(range_end)
  429. if range_start and range_end then
  430. for i = range_start, range_end do
  431. table.insert(got, i)
  432. end
  433. end
  434. else
  435. local num = tonumber(part)
  436. if num then
  437. table.insert(got, num)
  438. end
  439. end
  440. end
  441.  
  442. local unique = {}
  443. for _, v in ipairs(got) do
  444. unique[v] = true
  445. end
  446.  
  447. got = {}
  448. for k in pairs(unique) do
  449. table.insert(got, k)
  450. end
  451.  
  452. return got
  453. end
  454.  
  455. local function formatErrorMessage(msg)
  456. return msg:split(':')[#msg:split(':')]
  457. end
  458.  
  459. local function sayError(msg)
  460. chatMessage(tostring(formatErrorMessage(msg)))
  461. end
  462.  
  463. local function newCommand(names, args, func)
  464. table.insert(commands, {
  465. ['names'] = names,
  466. ['args'] = args,
  467. ['function'] = func,
  468. })
  469. end
  470.  
  471. local function isOkay(what)
  472. chatMessage(`{what} (Y/N)`)
  473.  
  474. local y,n
  475. local isYes = nil
  476. local timeout = tick()+10
  477.  
  478. y = getgenv().botsystem.chatsystem['agree'].Event:Once(function()
  479. isYes = true
  480. n:Disconnect()
  481. end)
  482.  
  483. n = getgenv().botsystem.chatsystem['disagree'].Event:Once(function()
  484. isYes = false
  485. y:Disconnect()
  486. end)
  487.  
  488. repeat wait() until isYes ~= nil or tick() - timeout > 0
  489.  
  490. return isYes
  491. end
  492.  
  493. local function decodeid(input)
  494. local a=string.byte('e')-1
  495.  
  496. input=input:gsub('>','')
  497. local out = ''
  498. print(input)
  499.  
  500. for i=1,#input do
  501. local num = input:sub(i,i)
  502. -- print(num)
  503. -- print(string.byte(num)-a)
  504. out=out..(string.byte(num)-a)
  505. end
  506.  
  507. return out
  508. end
  509.  
  510. newCommand({'test'},{},function(speaker, args)
  511. if isOwner(speaker) then
  512. chatMessage(`{tostring(speaker)} just tested a command with arg1 being {tostring(args[1])}`)
  513. end
  514. end)
  515.  
  516. local stackLoop
  517.  
  518. newCommand({'hat','stack'},{'player:player'},function(speaker, args)
  519. if stackLoop and stackLoop.Connected then
  520. stackLoop:Disconnect()
  521. local hum = lp.Character:FindFirstChildWhichIsA('Humanoid')
  522. if hum and hum.Health > 0 then
  523. hum.PlatformStand = false
  524. end
  525. end
  526. local players = funcs.getPlayerUsingMetrics(speaker,(args[1] == nil or args[1] == '') and 'me' or args[1])
  527. local v = players[1]
  528.  
  529. if not v then return end
  530.  
  531. local char = v.Character
  532.  
  533. local order = getOrder(lp.Name) or 1 + lineOffset
  534.  
  535. stackLoop = game:GetService('RunService').Stepped:Connect(function(_,delta)
  536. local root = lp.Character.HumanoidRootPart
  537. local hum = lp.Character:FindFirstChildWhichIsA('Humanoid')
  538. root.AssemblyLinearVelocity = Vector3.new(0,2.1,0)
  539.  
  540. if v.Character and v.Character:FindFirstChild('HumanoidRootPart') and v.Character:FindFirstChildWhichIsA('Humanoid') and v.Character:FindFirstChildWhichIsA('Humanoid').Health > 0 then
  541. local thead = v.Character:FindFirstChild('Head')
  542.  
  543. if thead then
  544. root.CFrame = thead.CFrame*CFrame.new(0,-1.4+order*4.9,0)
  545. if hum and hum.Health > 0 then
  546. hum.PlatformStand = true
  547. else
  548. stackLoop:Disconnect()
  549. end
  550. end
  551. else
  552. stackLoop:Disconnect()
  553. end
  554. end)
  555.  
  556. table.insert(getgenv().botsystem.connections,stackLoop)
  557. end)
  558.  
  559. newCommand({'unhat','unstack'},{'player:player'},function(speaker, args)
  560. if stackLoop and stackLoop.Connected then
  561. stackLoop:Disconnect()
  562. local hum = lp.Character:FindFirstChildWhichIsA('Humanoid')
  563. if hum and hum.Health > 0 then
  564. hum.PlatformStand = false
  565. end
  566. end
  567. end)
  568.  
  569. newCommand({'runanim','anim','runanimation','animate'},{'id:number|string'},function(speaker, args)
  570. if args[1] == nil then return end
  571. local looped = args[2] == 'true' and true or false
  572. local id = tonumber(args[1])
  573. if not id then
  574. warn(args[1])
  575. id = decodeid(args[1])
  576. end
  577.  
  578. local hum = lp.Character.Humanoid
  579.  
  580. -- for i,v in pairs(hum.Animator:GetPlayingAnimationTracks()) do
  581. -- v:Stop()
  582. -- end
  583.  
  584. local ani = Instance.new("Animation")
  585. ani.AnimationId = 'rbxassetid://'..id
  586. local track = hum.Animator:LoadAnimation(ani)
  587. if args[2] ~= nil then
  588. track.Looped = looped
  589. end
  590. track:Play()
  591. end)
  592.  
  593. newCommand({'stopanimation','stopanim','stopanimations','haltanim','haltanims','resetanim','resetanims'},{},function(speaker, args)
  594. local char = lp.Character
  595. local hum = char:FindFirstChildOfClass("Humanoid") or char:FindFirstChildOfClass("AnimationController")
  596.  
  597. for i,v in next, hum:GetPlayingAnimationTracks() do
  598. v:Stop()
  599. end
  600.  
  601. wait()
  602.  
  603. -- if char:FindFirstChild('Animate') and char:FindFirstChild('Animate'):FindFirstChild('idle') then
  604. -- local val = char:FindFirstChild('Animate') and char:FindFirstChild('Animate'):FindFirstChild('idle')
  605. -- local ani = val:FindFirstChild('Animation1')
  606. -- if ani then
  607. -- local track = hum.Animator:LoadAnimation(ani)
  608. -- track:Play()
  609. -- end
  610. -- end
  611.  
  612. if char:FindFirstChild('Animate') then
  613. char:FindFirstChild('Animate').Enabled = false
  614. task.wait()
  615. char:FindFirstChild('Animate').Enabled = true
  616. end
  617. end)
  618.  
  619. newCommand({'copyanim'},{'player:player'},function(speaker, args)
  620. local players = funcs.getPlayerUsingMetrics(speaker,args[1])
  621. local v = players[1]
  622.  
  623. if not v then return end
  624.  
  625. local char = v.Character
  626. for _, v1 in pairs(lp.Character:FindFirstChildOfClass('Humanoid'):GetPlayingAnimationTracks()) do
  627. v1:Stop()
  628. end
  629. for _, v1 in pairs(v.Character:FindFirstChildOfClass('Humanoid'):GetPlayingAnimationTracks()) do
  630. if not string.find(v1.Animation.AnimationId, "507768375") then
  631. local ANIM = lp.Character:FindFirstChildOfClass('Humanoid'):LoadAnimation(v1.Animation)
  632. ANIM:Play(.1, 1, v1.Speed)
  633. ANIM.TimePosition = v1.TimePosition
  634. ANIM.Looped=v1.Looped
  635. task.spawn(function()
  636. v1.Stopped:Wait()
  637. ANIM:Stop()
  638. ANIM:Destroy()
  639. end)
  640. end
  641. end
  642. end)
  643.  
  644. newCommand({'disconnect','disconnectconnections','removeconnections'},{},function(speaker, args)
  645. if isOwner(speaker) then
  646. if isOkay('This may break things, and shouldn\'t be used. Are you sure?') then
  647. chatMessage('Disconnecting and destroying connections...')
  648. for i, v in getgenv().botsystem.connections do
  649. pcall(function() v:Disconnect() end)
  650. end
  651. for i, v in getgenv().botsystem.todestroy do
  652. pcall(function() v:Destroy() end)
  653. end
  654. end
  655. end
  656. end)
  657.  
  658. newCommand({'rendering','setrendering'},{'on / off:bool'},function(speaker, args)
  659. if isOwner(speaker) then
  660. local tru = {
  661. 'true',
  662. 'enable',
  663. }
  664. local fals = {
  665. 'false',
  666. 'disable',
  667. }
  668.  
  669. if args[1] == nil then
  670. chatMessage(`COBRA Warning // Invalid argument for #1.`)
  671. else
  672. if table.find(tru,args[1]) then
  673. game:GetService('RunService'):Set3dRenderingEnabled(true)
  674. elseif table.find(fals,args[1]) then
  675. game:GetService('RunService'):Set3dRenderingEnabled(false)
  676. end
  677. end
  678. end
  679. end)
  680.  
  681. newCommand({'setfpscap','fpscap'},{},function(speaker, args)
  682. if isOwner(speaker) then
  683. local n = tonumber(args[1])
  684. if n then
  685. local out = math.clamp(n,30,90)
  686. setfpscap(out)
  687. if n~=out then
  688. chatMessage(`COBRA Warning // Fps is clamped to ensure stability! // Set to {out}.`)
  689. end
  690. else
  691. setfpscap(60)
  692. end
  693. end
  694. end)
  695.  
  696. newCommand({'speakorder','order'},{},function(speaker, args)
  697. if isOwner(speaker) then
  698. local d = getOrder(lp.Name) or 1
  699. for i=1,d do task.wait() task.wait() end
  700. chatMessage(tostring(d))
  701. end
  702. end)
  703.  
  704. newCommand({'stats'},{},function(speaker, args)
  705. local statsService = game:GetService("Stats")
  706.  
  707. local startTime = os.clock()
  708. local frameCount = 0
  709.  
  710. local connection
  711. connection = game:GetService("RunService").RenderStepped:Connect(function()
  712. frameCount += 1
  713. end)
  714.  
  715. task.wait(.25)
  716.  
  717. connection:Disconnect()
  718.  
  719. local fps = frameCount*4
  720.  
  721. local networkStats = statsService.Network.ServerStatsItem["Data Ping"]
  722. local ping = networkStats and math.ceil(networkStats:GetValue()) or "Unavailable"
  723.  
  724. local userSettings = UserSettings():GetService("UserGameSettings")
  725. local graphicsQuality = tonumber(userSettings.SavedQualityLevel.Name:sub(#'QualityLevel' + 1))
  726.  
  727. chatMessage(string.format("FPS: %d // Ping: %s ms", fps, ping))
  728. end)
  729.  
  730. -- local function getlevels()
  731. -- local userSettings = UserSettings():GetService("UserGameSettings")
  732. -- local qualityLevel = tonumber(userSettings.SavedQualityLevel.Name:sub(#'QualityLevel' + 1))
  733. -- local volumeLevel = math.floor(userSettings.MasterVolume * 10)
  734.  
  735. -- local levels = {
  736. -- ['graphics'] = qualityLevel,
  737. -- ['volume'] = volumeLevel,
  738. -- }
  739.  
  740. -- return levels
  741. -- end
  742.  
  743. newCommand({'setting','setsetting'},{'setting','value'},function(speaker, args)
  744. if isOwner(speaker) then
  745. -- local settingz = {
  746. -- ['graphics'] = 15,
  747. -- ['volume'] = 11,
  748. -- }
  749. -- if args[1] and settingz[args[1]] then else return chatMessage('No setting found.') end
  750. if args[2] and tonumber(args[2]) then else return chatMessage('Value is not a number.') end
  751.  
  752.  
  753.  
  754. UserSettings():GetService("UserGameSettings").MasterVolume = 0
  755.  
  756. -- local esc = Enum.KeyCode.Escape
  757. -- local tab = Enum.KeyCode.Tab
  758. -- local down = Enum.KeyCode.Down
  759. -- local left = Enum.KeyCode.Left
  760. -- local right = Enum.KeyCode.Right
  761.  
  762. -- local target = args[2]
  763. -- local toEdit = args[1]
  764.  
  765. -- target = math.clamp(target, 0, 10)
  766.  
  767. -- local levels = getlevels()
  768.  
  769. -- local level = levels[toEdit] or 0
  770.  
  771. -- local vim = game:GetService("VirtualInputManager")
  772.  
  773. -- local function press(key)
  774. -- vim:SendKeyEvent(true, key, false, game)
  775. -- task.wait(0.05)
  776. -- vim:SendKeyEvent(false, key, false, game)
  777. -- end
  778.  
  779. -- if game:GetService("GuiService").MenuIsOpen then
  780. -- while game:GetService("GuiService").MenuIsOpen do
  781. -- press(esc)
  782. -- task.wait(0.5)
  783. -- end
  784. -- end
  785.  
  786. -- press(esc)
  787. -- task.wait(0.05)
  788. -- press(tab)
  789. -- task.wait(0.1)
  790.  
  791. -- for _ = 1, settingz[toEdit] do
  792. -- task.wait()
  793. -- press(down)
  794. -- end
  795.  
  796. -- local adjustment = target - level
  797.  
  798. -- local keyToPress = adjustment > 0 and right or left
  799.  
  800. -- for _ = 1, math.abs(adjustment) do
  801. -- task.wait()
  802. -- press(keyToPress)
  803. -- end
  804.  
  805. -- press(esc)
  806.  
  807. -- if toEdit == 'graphics' then
  808. -- target = math.clamp(target,1,10)
  809. -- end
  810.  
  811. -- local levels = getlevels()
  812.  
  813. -- if levels[toEdit] == target then
  814. -- chatMessage(`Successfully set {toEdit} to {target}`)
  815. -- else
  816. -- chatMessage('COBRA Warning // Failed to set settings! // Something might be messed up.')
  817. -- end
  818. end
  819. end)
  820.  
  821. newCommand({'rejoin','rj'},{},function(speaker, args)
  822. if isOwner(speaker) then
  823. chatMessage(`COBRA Rejoin // Rejoining induces instability. // Some account(s) may not join back!`)
  824. chatMessage(`COBRA Rejoin // This is a development system! // Relaunch required!`)
  825. wait(1)
  826. if queueteleport then
  827. local on = [[]]
  828. queueteleport(on)
  829. end
  830. wait(.1)
  831. lp:Kick("\nRejoining...")
  832. wait()
  833. game:GetService('TeleportService'):Teleport(game.PlaceId, lp)
  834. end
  835. end)
  836.  
  837. local watchlooped = false
  838.  
  839. newCommand({'lookat','watch'},{'player:player','speed:number|bool'},function(speaker, args)
  840. if watchlooped then watchlooped = false wait(.5) end
  841.  
  842. local players = funcs.getPlayerUsingMetrics(speaker,args[1])
  843. local target = players[1]
  844.  
  845. if target then
  846. local root = target.Character.PrimaryPart
  847. local lroot = lp.Character.HumanoidRootPart
  848.  
  849. if root and lroot then
  850.  
  851. local speed = 0
  852. watchlooped = false
  853.  
  854. if args[2] and tonumber(args[2]) then
  855. speed = math.clamp( tonumber(args[2]), 0, 5)
  856. elseif args[2] == 'true' then
  857. watchlooped = true
  858. end
  859.  
  860. repeat
  861. local targetPosition = root.Position
  862. local playerPosition = lroot.Position
  863.  
  864. local direction = Vector3.new(targetPosition.X - playerPosition.X, 0, targetPosition.Z - playerPosition.Z).Unit
  865. local epos = CFrame.new(playerPosition, playerPosition + direction)
  866. TS:Create(lroot, TweenInfo.new(speed), {CFrame = epos}):Play()
  867. wait()
  868. until not watchlooped
  869. else
  870. chatMessage('Root part not found.')
  871. end
  872. else
  873. chatMessage('No player found.')
  874. end
  875. end)
  876.  
  877. newCommand({'unlookat','unwatch'},{},function(speaker, args)
  878. watchlooped = false
  879. end)
  880.  
  881. newCommand({'skiddie'},{},function(speaker, args)
  882. if isOwner(speaker) then
  883. chatMessage(`This is NOT a script you can have, take, or find.`)
  884. chatMessage(`You cannot buy this or have it be sent to you in any way.`)
  885. end
  886. end)
  887.  
  888. newCommand({'credits','owner'},{},function(speaker, args)
  889. chatMessage(`COBRA Credits // Script made by thedenteda // {getgenv().botsystem.version}`)
  890. end)
  891.  
  892. newCommand({'dance','emote','e'},{'emote name:string'},function(speaker, args)
  893. if args[1] == 'stop' then lp.Character.Humanoid.Sit = true task.wait(.01) lp.Character.Humanoid.Sit = false return end
  894. local ani =lp.Character:FindFirstChild('Animate')
  895. if ani and ani:FindFirstChild('PlayEmote') then
  896. local res = ani:FindFirstChild('PlayEmote'):Invoke(tostring(args[1]))
  897.  
  898. if not res then
  899. chatMessage('Couldn\'t play that emote.')
  900. end
  901. end
  902. end)
  903.  
  904. newCommand({'firework','antiair','aa'},{},function(speaker, args)
  905. local char = lp.Character
  906. local pp = char.HumanoidRootPart
  907.  
  908. TS:Create(pp, TweenInfo.new(.5),{AssemblyLinearVelocity = Vector3.new(0,250,0)}):Play()
  909. wait(.6)
  910. TS:Create(pp, TweenInfo.new(.25),{AssemblyAngularVelocity = Vector3.new(0,300,0)}):Play()
  911. wait(.3)
  912. char:FindFirstChildWhichIsA('Humanoid').Health = 0
  913. end)
  914.  
  915. local wondering = false
  916.  
  917. newCommand({'wonder','aimlesslywalk','findfather'},{},function(speaker, args)
  918. wondering = true
  919. task.spawn(function()
  920. while wondering and wait(math.random(1,3)) do
  921. if lp.Character and
  922. lp.Character:FindFirstChild("Humanoid") and
  923. lp.Character:FindFirstChild("HumanoidRootPart") then
  924.  
  925. local currentPos = lp.Character.HumanoidRootPart.Position
  926. local randomOffset = Vector3.new(
  927. math.random(-20, 20),
  928. 0,
  929. math.random(-20, 20)
  930. )
  931. local targetPos = currentPos + randomOffset
  932. lp.Character.Humanoid:MoveTo(targetPos)
  933. end
  934. end
  935. end)
  936. end)
  937.  
  938. newCommand({'unwonder','unaimlesslywalk','unfindfather','nofather'},{},function(speaker, args)
  939. wondering = false
  940. end)
  941.  
  942. newCommand({'explode','boom'},{'size (optional):number'},function(speaker, args)
  943. local char = lp.Character
  944. local pp = char.HumanoidRootPart
  945. local size = tonumber(args[1]) and tonumber(args[1])*100 or 10*100
  946.  
  947. TS:Create(pp, TweenInfo.new(.25),{AssemblyAngularVelocity = Vector3.new(0,size,0)}):Play()
  948. wait(.3)
  949. char:FindFirstChildWhichIsA('Humanoid').Health = 0
  950. end)
  951.  
  952. newCommand({'version'},{},function(speaker, args)
  953. chatMessage(`COBRA Version // {tostring(cinfo.version)}`)
  954. end)
  955.  
  956. newCommand({'identifysystem','name'},{},function(speaker, args)
  957. chatMessage(`{tostring(cinfo.name)} // {tostring(cinfo.longname)}`)
  958. end)
  959.  
  960. local antiafk
  961.  
  962. newCommand({'antiafk','antiidle'},{'set to <true, false> or status (optional)', '(if arg1 = true) should disconnect anyway?:bool'},function(speaker, args)
  963. if args[1] == nil or args[1] == '' or args[1] == 'true' then
  964. if antiafk and antiafk.Connected then
  965. if args[2] == 'true' then
  966. antiafk:Disconnect()
  967. wait()
  968. else
  969. chatMessage('Antiafk is already running.')
  970. return
  971. end
  972. end
  973. local VirtualUser = cloneref(game:GetService("VirtualUser"))
  974. antiafk = lp.Idled:Connect(function()
  975. VirtualUser:CaptureController()
  976. VirtualUser:ClickButton2(Vector2.new())
  977. end)
  978. table.insert(getgenv().botsystem.connections,antiafk)
  979. getgenv().botsystem.antiidle = true
  980. chatMessage('Antiafk online!')
  981. elseif args[1] == 'disconnect' or args[1] == 'false' then
  982. if isOwner(speaker) then
  983. if table.find(getgenv().botsystem.connections, antiafk) then
  984. table.remove(getgenv().botsystem.connections,table.find(getgenv().botsystem.connections, antiafk))
  985. end
  986. if antiafk and antiafk.Connected then
  987. antiafk:Disconnect()
  988. getgenv().botsystem.antiidle = false
  989. chatMessage('Antiafk disabled.')
  990. end
  991. end
  992. elseif args[1] == 'status' then
  993. chatMessage(`Anti-Idle status: {tostring(antiafk and antiafk.Connected or false)}`)
  994. end
  995. end)
  996.  
  997. newCommand({'close','exit'},{},function(speaker, args)
  998. if isOwner(speaker) then
  999. local leaving = {
  1000. 'Good bye!',
  1001. 'Bye!',
  1002. 'Cya!',
  1003. 'Adios!',
  1004. 'self = nil',
  1005. '...',
  1006. }
  1007. COBRA_Active = false
  1008. chatMessage(leaving[math.random(1,#leaving)])
  1009. wait(1)
  1010. game:Shutdown()
  1011. end
  1012. end)
  1013.  
  1014. newCommand({'cmere','bring'},{},function(speaker, args)
  1015. local lroot = lp.Character.HumanoidRootPart
  1016. local sroot = speaker.Character.HumanoidRootPart
  1017. lroot.CFrame = sroot.CFrame * CFrame.new(0,0,-3) * CFrame.Angles(0,math.rad(180),0)
  1018. end)
  1019.  
  1020. newCommand({'reset'},{},function(speaker, args)
  1021. local lhum = lp.Character.Humanoid
  1022. lhum.Health = 0
  1023.  
  1024. local targets = funcs.getPlayerUsingMetrics(speaker,args[1])
  1025.  
  1026. if targets and targets[1] then
  1027. local target = targets[1]
  1028. end
  1029. end)
  1030.  
  1031. local walkto
  1032.  
  1033. local function pathTo(path,v,hum)
  1034.  
  1035. path:ComputeAsync(lp.Character.PrimaryPart.Position, v.Character.PrimaryPart.Position)
  1036. local waypoints = path:GetWaypoints()
  1037. local distance
  1038. for waypointIndex, waypoint in pairs(waypoints) do
  1039. local waypointPosition = waypoint.Position
  1040. hum:MoveTo(waypointPosition)
  1041. -- repeat
  1042. -- distance = (waypointPosition - hum.Parent.PrimaryPart.Position).magnitude
  1043. -- wait()
  1044. -- if walkto == false then
  1045. -- return
  1046. -- end
  1047. -- until
  1048. -- distance <= 5
  1049. hum.MoveToFinished:Wait()
  1050.  
  1051. if walkto == false then
  1052. return
  1053. end
  1054.  
  1055. if waypointIndex % 5 == 0 then
  1056. path()
  1057. end
  1058. end
  1059. end
  1060.  
  1061. newCommand({'walkto','follow','chase'},{'player:player'},function(speaker, args)
  1062. walkto = false
  1063. wait(.5)
  1064. local players = funcs.getPlayerUsingMetrics(speaker,args[1] == nil and 'me' or args[1])
  1065. local hum = lp.Character:FindFirstChildOfClass("Humanoid")
  1066. local path = game:GetService('PathfindingService'):CreatePath()
  1067. for i,v in pairs(players)do
  1068. if v.Character ~= nil then
  1069. if lp.Character:FindFirstChildOfClass('Humanoid') and lp.Character:FindFirstChildOfClass('Humanoid').SeatPart then
  1070. lp.Character:FindFirstChildOfClass('Humanoid').Sit = false
  1071. wait(.1)
  1072. end
  1073. walkto = true
  1074. repeat wait()
  1075. local success, response = pcall(function()
  1076. pathTo(path,v,hum)
  1077. end)
  1078. if not success then
  1079. if lp.Character and lp.Character:FindFirstChildOfClass('Humanoid') and lp.Character:FindFirstChildOfClass('Humanoid').Health > 0 then
  1080. lp.Character:FindFirstChildOfClass('Humanoid'):MoveTo(v.Character.PrimaryPart.Position)
  1081. end
  1082. end
  1083. until v.Character == nil or not v.Character or walkto == false
  1084. end
  1085. end
  1086. end)
  1087.  
  1088. newCommand({'unwalkto','unfollow','unchase'},{},function(speaker, args)
  1089. walkto = false
  1090. end)
  1091.  
  1092. local bangLoop
  1093. local bangDied
  1094.  
  1095. newCommand({'bng','bang'},{'player:player','speed:number'},function(speaker, args)
  1096. if bangDied or bangLoop then
  1097. if bangDied then bangDied:Disconnect() end
  1098. bang:Stop()
  1099. bangAnim:Destroy()
  1100. if bangLoop then bangLoop:Disconnect() end
  1101. wait(.5)
  1102. end
  1103.  
  1104. local players = funcs.getPlayerUsingMetrics(speaker,args[1])
  1105.  
  1106. if players and players[1] then
  1107. local v = players[1]
  1108.  
  1109. local humanoid = lp.Character:FindFirstChildWhichIsA("Humanoid")
  1110. bangAnim = Instance.new("Animation")
  1111. bangAnim.AnimationId = "rbxassetid://5918726674"
  1112. bang = humanoid:LoadAnimation(bangAnim)
  1113. bang:Play(0.1, 1, 1)
  1114. bang:AdjustSpeed(args[2] or 3)
  1115. table.insert(getgenv().botsystem.todestroy, bang)
  1116. bangDied = humanoid.Died:Connect(function()
  1117. bang:Stop()
  1118. bangAnim:Destroy()
  1119. bangDied:Disconnect()
  1120. bangLoop:Disconnect()
  1121. end)
  1122. table.insert(getgenv().botsystem.connections,bangDied)
  1123. local bangplr = v.Name
  1124. local bangOffet = CFrame.new(0, 0, 1.1)
  1125. bangLoop = game:GetService('RunService').Stepped:Connect(function()
  1126. pcall(function()
  1127. local otherRoot = v.Character.HumanoidRootPart
  1128. lp.Character.HumanoidRootPart.CFrame = otherRoot.CFrame * bangOffet
  1129. lp.Character.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(0,2.1,0)
  1130. end)
  1131. end)
  1132. table.insert(getgenv().botsystem.connections,bangLoop)
  1133. end
  1134. end)
  1135.  
  1136. newCommand({'unbng','unbang'},{},function(speaker, args)
  1137. if bangDied or bangLoop then
  1138. if bangDied then bangDied:Disconnect() end
  1139. bang:Stop()
  1140. bangAnim:Destroy()
  1141. if bangLoop then bangLoop:Disconnect() end
  1142. end
  1143. end)
  1144.  
  1145. local orbitLoop
  1146. local orbitLoop2
  1147.  
  1148. newCommand({'orbit'},{'player:player','follow rotation:bool','speed:number'},function(speaker, args, spook)
  1149. if orbitLoop2 and orbitLoop2.Connected or orbitLoop and orbitLoop.Connected then
  1150. if spook or isOkay('Another "orbit" detected. Would you like to disconnect it?') then
  1151. chatMessage('Disconnecting and launching...')
  1152. runCommand(speaker, 'unorbit', {})
  1153. wait(.5)
  1154. else
  1155. chatMessage('Launching another "orbit." One second...')
  1156. end
  1157. end
  1158.  
  1159. local players = funcs.getPlayerUsingMetrics(speaker,args[1] and args[1] or 'me')
  1160.  
  1161. if players and players[1] then
  1162. local v = players[1]
  1163. local rot = 0
  1164. local speed = tonumber(args[3]) or 1
  1165. local followCF = args[2] == 'true' and true or args[2] == 'false' and false
  1166. local order = getOrder(lp.Name) or 1 + lineOffset
  1167.  
  1168. orbitLoop = game:GetService('RunService').Stepped:Connect(function(_,delta)
  1169. local root = lp.Character.HumanoidRootPart
  1170. root.AssemblyLinearVelocity = Vector3.new(0,2.1,0)
  1171. root.Anchored = false
  1172. rot += 1 * speed * (delta * 100) * (1 + (order * .1))
  1173. if v.Character and v.Character:FindFirstChild('HumanoidRootPart') and v.Character:FindFirstChildWhichIsA('Humanoid') and v.Character:FindFirstChildWhichIsA('Humanoid').Health > 0 then
  1174. local otherroot = v.Character:FindFirstChild('HumanoidRootPart')
  1175.  
  1176. local mult = 2
  1177.  
  1178. local offset = CFrame.new(0,0,-7.5)
  1179. local target = followCF and otherroot.CFrame or CFrame.new(otherroot.CFrame.Position)
  1180.  
  1181. target *= CFrame.Angles(0,math.rad(rot),0)
  1182.  
  1183. offset *= CFrame.new(0,0,(-order*mult)+(mult))
  1184.  
  1185. root.CFrame = target * offset * CFrame.Angles(0,math.rad(180),0)
  1186. wait()
  1187. root.Anchored = false
  1188. else
  1189. orbitLoop:Disconnect()
  1190. end
  1191.  
  1192. if spook then
  1193. if spook.tosay then
  1194. local shouldSay = math.random(1,750) == 1
  1195. if shouldSay then
  1196. chatMessage(tostring(spook.tosay[math.random(1,#spook.tosay)]))
  1197. end
  1198. end
  1199. end
  1200. end)
  1201.  
  1202. table.insert(getgenv().botsystem.connections,orbitLoop)
  1203. else
  1204. chatMessage('No player(s) found.')
  1205. end
  1206. end)
  1207.  
  1208. newCommand({'orbit2'},{'player:player','distance:number','speed:number'},function(speaker, args, spook)
  1209. if orbitLoop2 and orbitLoop2.Connected or orbitLoop and orbitLoop.Connected then
  1210. if isOkay('Another "orbit" detected. Would you like to disconnect it?') then
  1211. chatMessage('Got it. Disconnecting and launching...')
  1212. runCommand(speaker, 'unorbit', {})
  1213. wait(.5)
  1214. else
  1215. chatMessage('Launching another "orbit." One second...')
  1216. end
  1217. end
  1218.  
  1219. local speed = tonumber(args[3]) or 1
  1220. local rotated = 0
  1221. local players = funcs.getPlayerUsingMetrics(speaker,args[1] and args[1] or 'me')
  1222.  
  1223. if players and players[1] then else return chatMessage('No player(s) found.') end
  1224.  
  1225. print(players[1])
  1226. print(args[1])
  1227. print(args[1] and args[1] or 'me')
  1228.  
  1229. orbitLoop2 = game:GetService('RunService').Stepped:Connect(function(_,delta)
  1230. local online = getOnlineBots()
  1231. local order = getOrder(lp.Name)
  1232. rotated += 1 * speed * (delta * 100)
  1233.  
  1234. local splitBy = 360/#online
  1235.  
  1236. local rot = CFrame.Angles(0,math.rad(splitBy*order + rotated),0)
  1237. local distance = tonumber(args[2]) or 5
  1238. distance = math.clamp(distance,0,99)
  1239.  
  1240. if players and players[1] then
  1241. local v = players[1]
  1242.  
  1243. if v.Character and v.Character:FindFirstChild('HumanoidRootPart') and v.Character:FindFirstChildWhichIsA('Humanoid') and v.Character:FindFirstChildWhichIsA('Humanoid').Health > 0 then
  1244.  
  1245. local rp = getRoot(v.Character)
  1246. local rpp = CFrame.new(rp.Position)
  1247.  
  1248. getRoot(lp.Character).CFrame = rpp*rot*CFrame.new(0,0,-distance)*CFrame.Angles(0,math.rad(180),0)
  1249.  
  1250. lp.Character.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(0,2.1,0)
  1251. else
  1252. orbitLoop2:Disconnect()
  1253. end
  1254. end
  1255. end)
  1256.  
  1257. table.insert(getgenv().botsystem.connections,orbitLoop2)
  1258. end)
  1259.  
  1260. newCommand({'unorbit'},{},function(speaker, args)
  1261. if orbitLoop then
  1262. orbitLoop:Disconnect()
  1263. local root = lp.Character.HumanoidRootPart
  1264. root.Anchored = false
  1265. end
  1266. if orbitLoop2 then
  1267. orbitLoop2:Disconnect()
  1268. local root = lp.Character.HumanoidRootPart
  1269. root.Anchored = false
  1270. end
  1271. end)
  1272.  
  1273. newCommand({'spin'},{'speed:number'},function(speaker, args)
  1274. local spinSpeed = 20
  1275. if args[1] and tonumber(args[1]) then
  1276. spinSpeed = args[1]
  1277. end
  1278. for i,v in pairs(getRoot(lp.Character):GetChildren()) do
  1279. if v.Name == "Spinning" then
  1280. v:Destroy()
  1281. end
  1282. end
  1283. local Spin = Instance.new("BodyAngularVelocity")
  1284. Spin.Name = "Spinning"
  1285. Spin.Parent = getRoot(lp.Character)
  1286. Spin.MaxTorque = Vector3.new(0, math.huge, 0)
  1287. Spin.AngularVelocity = Vector3.new(0,spinSpeed,0)
  1288. end)
  1289.  
  1290. newCommand({'unspin'},{},function(speaker, args)
  1291. for i,v in pairs(lp.Character.HumanoidRootPart:GetChildren()) do
  1292. if v.Name == "Spinning" then
  1293. v:Destroy()
  1294. end
  1295. end
  1296. end)
  1297.  
  1298. newCommand({'circle'},{'player:player','distance:number'},function(speaker, args)
  1299. local online = getOnlineBots()
  1300. local order = getOrder(lp.Name)
  1301.  
  1302. local splitBy = 360/#online
  1303.  
  1304. local rot = CFrame.Angles(0,math.rad(splitBy*order),0)
  1305. local players = funcs.getPlayerUsingMetrics(speaker,args[1] and args[1] or 'me')
  1306. local distance = tonumber(args[2]) or 5
  1307. distance = math.clamp(distance,0,99)
  1308.  
  1309. if players and players[1] then
  1310. local v = players[1]
  1311.  
  1312. local rp = getRoot(v.Character)
  1313. local rpp = CFrame.new(rp.Position)
  1314.  
  1315. getRoot(lp.Character).CFrame = rpp*rot*CFrame.new(0,0,-distance)*CFrame.Angles(0,math.rad(180),0)
  1316. end
  1317. end)
  1318.  
  1319. newCommand({'spook','crazy','scare'},{'player:player'},function(speaker, args)
  1320. -- local nargs = {}
  1321. -- for i,v in args do
  1322. -- if i==1 then continue end
  1323. -- nargs[i] = v
  1324. -- end
  1325.  
  1326. if orbitLoop then
  1327. orbitLoop:Disconnect()
  1328. wait(.5)
  1329. end
  1330.  
  1331. runCommand(speaker, 'orbit', {args[1], 'false', '3'}, {
  1332. ['tosay'] = {
  1333. 'You are losing your mind..',
  1334. 'It\'s in your walls.',
  1335. 'Wake up..',
  1336. 'You NEED to wake up..',
  1337. 'You can\'t hide forever...',
  1338. 'You can\'t run from the truth..',
  1339. 'the end is never the end is never',
  1340. },
  1341. })
  1342.  
  1343. end)
  1344.  
  1345. newCommand({'unspook','uncrazy','unscare'},{},function(speaker, args)
  1346. runCommand(speaker, 'unorbit', args)
  1347. chatMessage('You are safe.. for now.')
  1348. end)
  1349.  
  1350. newCommand({'sit'},{'value:bool'},function(speaker, args)
  1351. local hum = lp.Character:FindFirstChildWhichIsA('Humanoid')
  1352.  
  1353. local should = args[1] == 'true' and true or args[1] == 'false' and false
  1354.  
  1355. if args[1] == nil then
  1356. should = true
  1357. end
  1358.  
  1359. hum.Sit = should
  1360. end)
  1361.  
  1362. newCommand({'jump'},{},function(speaker, args)
  1363. local hum = lp.Character:FindFirstChildWhichIsA('Humanoid')
  1364. hum.Jump = true
  1365. end)
  1366.  
  1367. newCommand({'hh','hipheight'},{},function(speaker, args)
  1368. local hum = lp.Character:FindFirstChildWhichIsA('Humanoid')
  1369. hum.HipHeight = tonumber(args[1]) or (r15(lp) and 2.1 or 0)
  1370. end)
  1371.  
  1372. newCommand({'unsit'},{},function(speaker, args)
  1373. local hum = lp.Character:FindFirstChildWhichIsA('Humanoid')
  1374. hum.Sit = false
  1375. end)
  1376.  
  1377. newCommand({'unsit'},{},function(speaker, args)
  1378. local hum = lp.Character:FindFirstChildWhichIsA('Humanoid')
  1379. hum.Sit = false
  1380. end)
  1381.  
  1382. newCommand({'to','goto','line'},{'player:player','line type:string'},function(speaker, args)
  1383. local lroot = lp.Character.HumanoidRootPart
  1384. local result = funcs.getPlayerUsingMetrics(speaker,(args[1] == nil or args[1] == '') and 'me' or args[1])
  1385. local order = getOrder(lp.Name) or 1 + lineOffset
  1386. local mult = 3
  1387.  
  1388. local offset = CFrame.new(0,0,-3)
  1389.  
  1390. if args[2] == nil or args[2] == 'vertical' then
  1391. offset *= CFrame.new(0,0,(-order*mult)+(mult))
  1392. elseif args[2] == 'horizontal' then
  1393. mult = 4
  1394. offset *= CFrame.new((-order*mult)+(mult),0,0)
  1395. else
  1396. task.spawn(chatMessage,'Unknown line type; using vertical.')
  1397.  
  1398. offset *= CFrame.new(0,0,(-order*mult)+(mult))
  1399. end
  1400.  
  1401. if result and result[1] then
  1402. local sroot = result[1].Character.HumanoidRootPart
  1403. lroot.CFrame = sroot.CFrame * offset * CFrame.Angles(0,math.rad(180),0)
  1404. else
  1405. chatMessage('No players found.')
  1406. end
  1407. end)
  1408.  
  1409. newCommand({'return'},{'to return:string'},function(speaker, args)
  1410. if isOwner(speaker) then
  1411. local s = [[local loadstring = function() error('Loadstring is disabled.') end
  1412. blocked = function(a) error('Function is locked.') end
  1413. local getgenv,getfenv = blocked,blocked
  1414. local getrenv,getsenv = blocked,blocked
  1415. local writefile,loadfile = blocked,blocked
  1416. local setclipboard,write_clipboard = blocked,blocked
  1417. local rawget = blocked
  1418. --local _G = {}
  1419. local db = {}
  1420.  
  1421. for i,v in pairs(debug) do
  1422. if type(v) == 'function' then
  1423. db[i] = blocked
  1424. else
  1425. db[i] = v
  1426. end
  1427. end
  1428.  
  1429. local debug = db
  1430. db = nil
  1431.  
  1432. ]]
  1433. local e = s..`return {args[1]}`
  1434. local got = loadstring(e)()
  1435. local out = got or 'There\'s no output for that.'
  1436. chatMessage(tostring(out))
  1437. end
  1438. end)
  1439.  
  1440. newCommand({'run','loadstring','ls'},{'code:string'},function(speaker, args)
  1441. if isOwner(speaker) then
  1442. local s = [[local loadstring = function() error('Loadstring is disabled.') end
  1443. blocked = function(a) error('Function is locked.') end
  1444. local getgenv,getfenv = blocked,blocked
  1445. local getrenv,getsenv = blocked,blocked
  1446. local writefile,loadfile = blocked,blocked
  1447. local setclipboard,write_clipboard = blocked,blocked
  1448. local rawget = blocked
  1449. --local _G = {}
  1450. local db = {}
  1451.  
  1452. for i,v in pairs(debug) do
  1453. if type(v) == 'function' then
  1454. db[i] = blocked
  1455. else
  1456. db[i] = v
  1457. end
  1458. end
  1459.  
  1460. local debug = db
  1461. db = nil
  1462.  
  1463. ]]
  1464. local all = ''
  1465. for i,v in args do
  1466. if v ~= nil then
  1467. all = all..' '..tostring(v)
  1468. end
  1469. end
  1470.  
  1471. if all:gsub(' ',''):match('whiletrue') then chatMessage('COBRA Security blocked your string.') return end
  1472. -- if all:match('getfenv') then chatMessage('COBRA Security blocked your string.') return end
  1473.  
  1474. local e = s..all
  1475. local s,err = pcall(function()
  1476. loadstring(e)()
  1477. end)
  1478.  
  1479. if not s then
  1480. warn(err)
  1481. chatMessage(`Code ran into an error; "{tostring(formatErrorMessage(err)):sub(2)}"`)
  1482. elseif err ~= nil then
  1483. chatMessage(`Code outputted: {tostring(err)}`)
  1484. end
  1485. end
  1486. end)
  1487.  
  1488. newCommand({'chat','say'},{'message:string'},function(speaker, args)
  1489. if isOwner(speaker) then
  1490. local all = ''
  1491. for i,v in args do
  1492. if v ~= nil then
  1493. all = all..' '..tostring(v)
  1494. end
  1495. end
  1496. chatMessage(tostring(all))
  1497. end
  1498. end)
  1499.  
  1500. newCommand({'clearchat'},{},function(speaker, args)
  1501. if TCS.ChatVersion == Enum.ChatVersion.TextChatService then
  1502. TCS.TextChannels.RBXGeneral:SendAsync("?"..string.rep('\r',180).."-- Cleared Chat --")
  1503. end
  1504. end)
  1505.  
  1506. newCommand({'announce'},{'message:string'},function(speaker, args)
  1507. if args[1] == nil then
  1508. args[1] = ''
  1509. end
  1510. args[1] = 'THIS IS NOT A DRILL:\r'..args[1]
  1511. if TCS.ChatVersion == Enum.ChatVersion.TextChatService then
  1512. TCS.TextChannels.RBXGeneral:SendAsync("?"..string.rep('\r',math.floor(185-(#tostring(args[1])/2)))..args[1])
  1513. end
  1514. end)
  1515.  
  1516. newCommand({'bot','acc'},{'account number:number','command:string','args'},function(speaker, args)
  1517. local order = getOrder(lp.Name)
  1518. local bots = numberLister(args[1] or '')
  1519.  
  1520. if table.find(bots,order) then
  1521.  
  1522. local nargs = {}
  1523. for i,v in args do
  1524. if i<=2 then continue end
  1525. table.insert(nargs, v)
  1526. end
  1527.  
  1528. runCommand(speaker, args[2], nargs)
  1529. end
  1530. end)
  1531.  
  1532. newCommand({'cmdinfo','cinfo','commandinfo'},{'cmd:string'},function(speaker, args)
  1533. local cmd = args[1]
  1534.  
  1535. if cmd == nil then
  1536. chatMessage('Provide a command.')
  1537. else
  1538. local got = getCommand(cmd)
  1539. if got then
  1540. local args = ''
  1541. for i,v in got.args do
  1542. args = `{args} <{v}>`
  1543. end
  1544. chatMessage(`{cmd}: {args}`)
  1545. else
  1546. chatMessage('No command found.')
  1547. end
  1548. end
  1549. end)
  1550.  
  1551. getgenv().botsystem.newscriptloaded.Event:Once(function()
  1552. walkto = false
  1553. watchlooped = false
  1554. COBRA_Active = false
  1555. wondering = false
  1556.  
  1557. lp.Character.PrimaryPart.Anchored = false
  1558. lp.Character.HumanoidRootPart.Anchored = false
  1559.  
  1560.  
  1561. local hum = lp.Character:FindFirstChildWhichIsA('Humanoid')
  1562. if hum.Sit then
  1563. lp.Character.HumanoidRootPart.CFrame *= CFrame.new(0,hum.HipHeight+2,0)
  1564. hum.Sit = false
  1565. end
  1566.  
  1567. if bangDied or bangLoop then
  1568. if bangDied then bangDied:Disconnect() end
  1569. bang:Stop()
  1570. bangAnim:Destroy()
  1571. if bangLoop then bangLoop:Disconnect() end
  1572. end
  1573. end)
  1574.  
  1575. local function prepandruncommand(msg,shouldreturn)
  1576.  
  1577. local source = msg.Text
  1578. local textSource = msg.TextSource
  1579.  
  1580. if textSource ~= nil and table.find(leaders,textSource.Name) then
  1581. if source:sub(1,#prefix) == prefix then
  1582. local newSource = source:sub(#prefix+1,#source)
  1583. local chunks = newSource:split(' ')
  1584.  
  1585. local command = chunks[1]
  1586. table.remove(chunks,1)
  1587. local args = chunks
  1588.  
  1589. local speaker
  1590.  
  1591. for i,v in pairs(plrs:GetPlayers()) do
  1592. if v:IsA('Player') and v.Name == textSource.Name then
  1593. speaker = v
  1594. end
  1595. end
  1596.  
  1597. local s,e = pcall(function()
  1598. runCommand(speaker, command, args)
  1599. end)
  1600.  
  1601. if not s then
  1602. warn(e)
  1603. chatMessage('An error occurred while running command:')
  1604. sayError(e)
  1605. end
  1606. elseif source:sub(1,#'_') == '_' then
  1607. local res = source:sub(#prefix+1,#source):lower()
  1608.  
  1609. local agree = {
  1610. 'yes',
  1611. 'ye',
  1612. 'y',
  1613. 'yea',
  1614. 'yeah',
  1615. 'agree',
  1616. 'accept',
  1617. }
  1618.  
  1619. local disagree = {
  1620. 'n',
  1621. 'no',
  1622. 'nah',
  1623. 'nope',
  1624. 'deny',
  1625. 'disagree',
  1626. }
  1627.  
  1628. if table.find(agree,res) then
  1629. getgenv().botsystem.chatsystem['agree']:Fire()
  1630. elseif table.find(disagree,res) then
  1631. getgenv().botsystem.chatsystem['disagree']:Fire()
  1632. end
  1633. end
  1634. end
  1635.  
  1636. end
  1637.  
  1638. local lastPing = nil
  1639.  
  1640. local function pingWS()
  1641. local WebSocket = getgenv().botsystem.websocket
  1642.  
  1643. if WebSocket == nil then return false end
  1644.  
  1645. WebSocket:Send('PING')
  1646.  
  1647. return true
  1648. end
  1649.  
  1650. task.spawn(function()
  1651. local WSConnect = syn and syn.websocket.connect or
  1652. (Krnl and (function() repeat task.wait() until Krnl.WebSocket and Krnl.WebSocket.connect return Krnl.WebSocket.connect end)()) or
  1653. WebSocket and WebSocket.connect
  1654.  
  1655. local http = game:GetService('HttpService')
  1656.  
  1657. local suc
  1658.  
  1659. if table.find(leaders,lp.Name) then
  1660. if WSConnect then
  1661. -- rconsoleclear()
  1662. local WebSocket = WSConnect("ws://127.0.0.1:"..port)
  1663. getgenv().botsystem.websocket = WebSocket
  1664.  
  1665. local gui = Instance.new('ScreenGui',game:GetService('CoreGui'))
  1666. gui.Name = 'COBRA CONTROL'
  1667. gui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  1668.  
  1669. table.insert(getgenv().botsystem.todestroy, gui)
  1670.  
  1671. local main = Instance.new('Frame',gui)
  1672. main.Size = UDim2.new(0,200,0,40)
  1673. main.Position = UDim2.new(0,10,0,330)
  1674. main.BackgroundColor3 = Color3.fromRGB(25,25,25)
  1675. main.AutomaticSize = Enum.AutomaticSize.X
  1676.  
  1677. local frame = Instance.new('Frame',main)
  1678. frame.Size = UDim2.new(0,200,0,40)
  1679. frame.Position = UDim2.new(0,0,0,0)
  1680. frame.BackgroundTransparency = 1
  1681. frame.AutomaticSize = Enum.AutomaticSize.X
  1682.  
  1683. local a = Instance.new('Frame',frame)
  1684. a.Size = UDim2.new(0,15,0,0)
  1685. a.LayoutOrder = 1
  1686. a.BackgroundTransparency = 1
  1687.  
  1688. local b = Instance.new('Frame',frame)
  1689. b.Size = UDim2.new(0,15,0,0)
  1690. b.LayoutOrder = 3
  1691. b.BackgroundTransparency = 1
  1692.  
  1693. local fontSize = 20
  1694.  
  1695. local tb = Instance.new('TextBox',frame)
  1696. tb.Text = ''
  1697. tb.LayoutOrder = 2
  1698. tb.Size = UDim2.new(0,200,0,40)
  1699. tb.TextColor3 = Color3.new(1,1,1)
  1700. tb.ClearTextOnFocus = false
  1701. tb.AutomaticSize = Enum.AutomaticSize.X
  1702. tb.BackgroundTransparency = 1
  1703. tb.TextTransparency = .9
  1704. tb.TextSize = fontSize
  1705. tb.Font = Enum.Font.Bodoni
  1706.  
  1707. local mask = Instance.new('TextLabel',main)
  1708. mask.Text = ''
  1709. mask.AnchorPoint = Vector2.new(.5,.5)
  1710. mask.Position = UDim2.fromScale(.5,.5)
  1711. mask.Size = UDim2.new(0,200,0,40)
  1712. mask.TextColor3 = Color3.new(1,1,1)
  1713. mask.AutomaticSize = Enum.AutomaticSize.X
  1714. mask.BackgroundTransparency = 1
  1715. mask.TextTransparency = 0
  1716. mask.TextSize = fontSize
  1717. mask.RichText = true
  1718. mask.Font = Enum.Font.Bodoni
  1719.  
  1720. local uic = Instance.new('UICorner',main)
  1721.  
  1722. local uill = Instance.new('UIListLayout',frame)
  1723. uill.FillDirection = Enum.FillDirection.Horizontal
  1724. uill.SortOrder = Enum.SortOrder.LayoutOrder
  1725.  
  1726. local uis = Instance.new('UIStroke',main)
  1727. uis.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  1728. uis.Color = Color3.new(.25,.25,.25)
  1729. uis.Thickness = 2
  1730.  
  1731. table.insert(getgenv().botsystem.connections,tb:GetPropertyChangedSignal("Text"):Connect(function()
  1732. local splits = tb.Text:split(' ')
  1733.  
  1734. --[[
  1735. make loadstring blue
  1736. more stuff
  1737. add dropdown? (autofill takes it place atm)
  1738. force cursor
  1739. ]]
  1740.  
  1741. if splits[1]:sub(1,#prefix) == prefix then
  1742. local res = splits[1]:sub(#prefix+1)
  1743.  
  1744. local out = '.'
  1745. local command
  1746.  
  1747. for i,v in splits do
  1748. if i == 1 then
  1749. local c = getCommand(res)
  1750. if c then
  1751. command = c
  1752. out = out..'<b>'..res..'</b>'
  1753. else
  1754. local closestCmd = string.rep('long',10)
  1755. local extra = ''
  1756. local tabbed = res:sub(#res) == ' '
  1757.  
  1758. if tabbed then
  1759. res = res:sub(1,#res-1)
  1760. end
  1761.  
  1762. for _, c in commands do
  1763. for _,n in c.names do
  1764. if n:lower():sub(1,res:len()) == res:lower() then
  1765. if n:len() < #closestCmd then
  1766. closestCmd = n
  1767. end
  1768. end
  1769. end
  1770. end
  1771.  
  1772. if tabbed then
  1773. tb.Text = prefix..closestCmd..' '
  1774. tb.CursorPosition = #tb.Text+1
  1775. out = out..'<b>'..closestCmd..'</b>'
  1776. else
  1777.  
  1778. if string.rep('long',10) ~= closestCmd then
  1779. extra = '<font transparency="0.25">'..closestCmd:sub(#res+1)..'</font>'
  1780. end
  1781.  
  1782. out = out..'<b><font color="rgb(255,75,75)">'..res..'</font></b>'..extra
  1783.  
  1784. end
  1785. end
  1786. elseif command then
  1787. local got = command.args[i-1] or ''
  1788. local want = {}
  1789.  
  1790. -- for i,val in got do
  1791. local spl = got:split(':')
  1792. if #spl >= 2 then
  1793. local a = spl[2]:split('|')
  1794. for i,typ in a do
  1795. table.insert(want,typ)
  1796. end
  1797. end
  1798. -- end
  1799.  
  1800. if table.find(want,'bool') and v == 'true' or v == 'false' or v == 'nil' then
  1801. out = out..' <b><font color="rgb(255,200,40)">'..v..'</font></b>'
  1802. elseif table.find(want,'number') and tonumber(v) then
  1803. out = out..' <font color="rgb(255,200,40)">'..v..'</font>'
  1804. elseif table.find(want,'player') then
  1805. local should = false
  1806.  
  1807. -- if v == 'me' or v == 'random' then
  1808. -- should = true
  1809. -- else
  1810. -- for i,p in pairs(plrs:GetPlayers()) do
  1811.  
  1812. -- end
  1813. -- end
  1814.  
  1815. -- local gotPlayer = funcs.getPlayerUsingMetrics(lp,v)
  1816.  
  1817. if #funcs.getPlayerUsingMetrics(lp,v) > 0 then
  1818. should = true
  1819. end
  1820.  
  1821. if should then
  1822. out = out..' <font color="rgb(243, 132, 247)">'..v..'</font>'
  1823. else
  1824. out = out..' <font color="rgb(255,75,75)">'..v..'</font>'
  1825. end
  1826.  
  1827. elseif table.find(want,'string') then
  1828. out = out..' <font color="rgb(173, 241, 149)">'..v..'</font>'
  1829. else
  1830. out = out..' <font color="rgb(255,75,75)">'..v..'</font>'
  1831. end
  1832. else
  1833.  
  1834. out = out..' '..v
  1835.  
  1836. end
  1837. end
  1838.  
  1839. mask.Text = out
  1840. elseif tb.Text:sub(1,1) == '_' then
  1841. mask.Text = '<font color="rgb(255,255,255)">'..tb.Text..'</font>'
  1842. else
  1843. mask.Text = '<font color="rgb(255,75,75)">'..tb.Text..'</font>'
  1844. end
  1845.  
  1846.  
  1847. -- frame2.Size = UDim2.fromOffset(frame.AbsoluteSize)
  1848. end))
  1849.  
  1850. table.insert(getgenv().botsystem.connections,tb.FocusLost:Connect(function(enter)
  1851. if enter then
  1852. local data = {
  1853. ['v1'] = false,
  1854. ['source'] = tb.Text,
  1855. ['speaker'] = lp.Name,
  1856. ['command'] = '',
  1857. ['args'] = {},
  1858. }
  1859.  
  1860. WebSocket:Send(http:JSONEncode(data))
  1861.  
  1862. tb.Text = ''
  1863. end
  1864. end))
  1865. end
  1866. else
  1867. if WSConnect then
  1868. local success,WebSocket = pcall(WSConnect,"ws://127.0.0.1:"..port)
  1869. suc = success
  1870. if success then
  1871. getgenv().botsystem.websocket = WebSocket
  1872.  
  1873. WebSocket.OnMessage:Connect(function(json)
  1874. if json == 'Active.' then
  1875. lastPing = tick()
  1876. else
  1877. local tab = http:JSONDecode(json)
  1878. -- if tab.speaker == lp.Name then return end
  1879.  
  1880. if tab.v1 then
  1881. runCommand(plrs:FindFirstChild(tab.speaker),tab.command,tab.args)
  1882. else
  1883. local msg = {
  1884. ['Text'] = tab.source,
  1885. ['TextSource'] = plrs:FindFirstChild(tab.speaker),
  1886. }
  1887. prepandruncommand(msg)
  1888. end
  1889. end
  1890. end)
  1891. else
  1892. if canprint then
  1893. rconsoleerr('Failed to connect to websocket: '..WebSocket)
  1894. else
  1895. warn('Failed to connect to websocket: '..WebSocket)
  1896. end
  1897. end
  1898. end
  1899. end
  1900.  
  1901. if suc then
  1902.  
  1903. while COBRA_Active do
  1904. wait(1)
  1905. local last = lastPing
  1906. local start = tick()
  1907. if pingWS() then
  1908.  
  1909. repeat wait() until last ~= lastPing or tick()-start>2
  1910. if tick()-start>2 then
  1911. if COBRA_Active then
  1912. if canprint then
  1913. rconsoleerr('WEBSOCKET DISCONNECTED')
  1914. else
  1915. warn('WEBSOCKET DISCONNECTED')
  1916. end
  1917. end
  1918.  
  1919. return
  1920. end
  1921. end
  1922. end
  1923. end
  1924. end)
  1925.  
  1926. plrs.PlayerRemoving:Connect(function(p)
  1927. if COBRA_Active then
  1928. if table.find(bots,p.Name) then
  1929. if canprint then
  1930. if getOrder(lp.Name) == 1 then
  1931. rconsolewarn(p.Name..' just exited!')
  1932. end
  1933. end
  1934. end
  1935. end
  1936. end)
  1937.  
  1938. local s, e = pcall(function()
  1939. TCS.OnIncomingMessage = function(msg)
  1940. local s,e = pcall(function()
  1941. if getgenv().botsystem == nil then chatMessage('Stored data is nil.') TCS.OnIncomingMessage = nil return end
  1942. if cinfo.current ~= getgenv().botsystem.current or table.find(leaders,lp.Name) then
  1943. walkto = false
  1944. task.wait(1)
  1945. TCS.OnIncomingMessage = nil
  1946. return
  1947. end
  1948.  
  1949. prepandruncommand(msg)
  1950. end)
  1951.  
  1952. if not s then
  1953. warn(e)
  1954. chatMessage('An error occurred in TCS:')
  1955. sayError(e)
  1956. end
  1957. end
  1958. end)
  1959.  
  1960. if not s then
  1961. warn(e)
  1962. chatMessage('An error occurred.')
  1963. sayError(e)
  1964. else
  1965. if not table.find(leaders,lp.Name) then
  1966. -- chatMessage(`COBRA // New version loaded. // {getgenv().botsystem.version}`)
  1967. if getgenv().botsystem.antiidle then
  1968. getgenv().botsystem.antiidle = false
  1969. -- chatMessage(`COBRA Warning // Anti-Idle got disconnected. // Reconnecting...`)
  1970. wait(.5)
  1971. runCommand(lp,'antiidle',{})
  1972. end
  1973.  
  1974. if identifyexecutor() == 'Wave' then
  1975. wait(1)
  1976. -- chatMessage(':O Wave?!?!!? You must have given in..')
  1977. end
  1978. end
  1979. end
Advertisement
Add Comment
Please, Sign In to add comment