KirchohexSX

Untitled

Feb 23rd, 2026 (edited)
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.73 KB | None | 0 0
  1. -- Enhanced Stand Script System
  2. -- Main account controls multiple alternative accounts via chat commands
  3.  
  4. local Players = game:GetService("Players")
  5. local RunService = game:GetService("RunService")
  6. local UserInputService = game:GetService("UserInputService")
  7. local TextChatService = game:GetService("TextChatService")
  8. local TweenService = game:GetService("TweenService")
  9. local HttpService = game:GetService("HttpService")
  10.  
  11. local localPlayer = Players.LocalPlayer
  12.  
  13. -- ======================
  14. -- CONFIGURATION SETTINGS
  15. -- ======================
  16. local CONFIG = {
  17. MAIN_USERNAME = "Gustavogus911", -- Set this to your main account's username
  18. COMMAND_PREFIX = "!",
  19. FOLLOW_DISTANCE = 5,
  20. FLOAT_HEIGHT = 5,
  21. FOLLOW_SPEED = 0.1,
  22. ORBIT_RADIUS = 8,
  23. ORBIT_SPEED = 1.5,
  24. LINE_SPACING = 3,
  25. STACK_SPACING = 3,
  26. BACKUP_SPACING = 4,
  27. VISIT_INTERVAL = 5,
  28. PANEL_POSITION = UDim2.new(0.5, 0, 0, 10),
  29. PANEL_SIZE = UDim2.new(0.3, 0, 0.15, 0),
  30. DEBUG_MODE = true
  31. }
  32.  
  33. -- ======================
  34. -- STATE MANAGEMENT
  35. -- ======================
  36. local STATE = {
  37. isMainAccount = (localPlayer.Name == CONFIG.MAIN_USERNAME),
  38. isFollowing = false,
  39. isFloating = false,
  40. isSpamming = false,
  41. isOrbiting = false,
  42. isLinedUp = false,
  43. isCounting = false,
  44. isStacked = false,
  45. isBackedUp = false,
  46. isVisiting = false,
  47. isDancing = false,
  48. spamContent = "",
  49. spamInterval = 4,
  50. spamThread = nil,
  51. followThread = nil,
  52. orbitThread = nil,
  53. countThread = nil,
  54. visitThread = nil,
  55. danceThread = nil,
  56. standUsers = {},
  57. standCount = 0,
  58. orbitAngles = {}, -- Store individual orbit angles for each alt
  59. linePositions = {}, -- Store line positions for each alt
  60. stackPositions = {}, -- Store stack positions for each alt
  61. backupPositions = {} -- Store backup positions for each alt
  62. }
  63.  
  64. -- Random words for advanced spam
  65. local ADVANCED_SPAM_WORDS = {"faith", "hope", "apple", "shok", "power", "light", "dark", "fire", "ice", "wind", "earth", "love", "hate", "joy", "sadness", "victory", "defeat"}
  66.  
  67. -- ======================
  68. -- UI CREATION
  69. -- ======================
  70. local function createStandUI()
  71. local screenGui = Instance.new("ScreenGui")
  72. screenGui.Name = "StandSystemUI"
  73. screenGui.Parent = localPlayer:WaitForChild("PlayerGui")
  74.  
  75. local mainFrame = Instance.new("Frame")
  76. mainFrame.Name = "MainPanel"
  77. mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
  78. mainFrame.BackgroundTransparency = 0.3
  79. mainFrame.BorderSizePixel = 0
  80. mainFrame.Position = CONFIG.PANEL_POSITION
  81. mainFrame.Size = CONFIG.PANEL_SIZE
  82. mainFrame.AnchorPoint = Vector2.new(0.5, 0)
  83. mainFrame.Parent = screenGui
  84.  
  85. local corner = Instance.new("UICorner")
  86. corner.CornerRadius = UDim.new(0, 8)
  87. corner.Parent = mainFrame
  88.  
  89. local title = Instance.new("TextLabel")
  90. title.Name = "Title"
  91. title.Text = "STAND SYSTEM"
  92. title.Font = Enum.Font.GothamBold
  93. title.TextSize = 18
  94. title.TextColor3 = Color3.fromRGB(255, 255, 255)
  95. title.BackgroundTransparency = 1
  96. title.Size = UDim2.new(1, 0, 0.2, 0)
  97. title.Parent = mainFrame
  98.  
  99. local userInfo = Instance.new("TextLabel")
  100. userInfo.Name = "UserInfo"
  101. userInfo.Text = "User: " .. localPlayer.Name
  102. userInfo.Font = Enum.Font.Gotham
  103. userInfo.TextSize = 14
  104. userInfo.TextColor3 = Color3.fromRGB(200, 200, 255)
  105. userInfo.BackgroundTransparency = 1
  106. userInfo.Size = UDim2.new(1, 0, 0.2, 0)
  107. userInfo.Position = UDim2.new(0, 0, 0.2, 0)
  108. userInfo.Parent = mainFrame
  109.  
  110. local roleInfo = Instance.new("TextLabel")
  111. roleInfo.Name = "RoleInfo"
  112. roleInfo.Text = "Role: " .. (STATE.isMainAccount and "MAIN" or "ALTERNATIVE")
  113. roleInfo.Font = Enum.Font.GothamBold
  114. roleInfo.TextSize = 16
  115. roleInfo.TextColor3 = STATE.isMainAccount and Color3.fromRGB(0, 200, 0) or Color3.fromRGB(255, 150, 0)
  116. roleInfo.BackgroundTransparency = 1
  117. roleInfo.Size = UDim2.new(1, 0, 0.2, 0)
  118. roleInfo.Position = UDim2.new(0, 0, 0.4, 0)
  119. roleInfo.Parent = mainFrame
  120.  
  121. local countInfo = Instance.new("TextLabel")
  122. countInfo.Name = "CountInfo"
  123. countInfo.Text = "Stand Users: 1"
  124. countInfo.Font = Enum.Font.Gotham
  125. countInfo.TextSize = 14
  126. countInfo.TextColor3 = Color3.fromRGB(255, 255, 255)
  127. countInfo.BackgroundTransparency = 1
  128. countInfo.Size = UDim2.new(1, 0, 0.2, 0)
  129. countInfo.Position = UDim2.new(0, 0, 0.6, 0)
  130. countInfo.Parent = mainFrame
  131.  
  132. local commandInfo = Instance.new("TextLabel")
  133. commandInfo.Name = "CommandInfo"
  134. commandInfo.Text = "Prefix: " .. CONFIG.COMMAND_PREFIX
  135. commandInfo.Font = Enum.Font.Gotham
  136. commandInfo.TextSize = 12
  137. commandInfo.TextColor3 = Color3.fromRGB(180, 180, 180)
  138. commandInfo.BackgroundTransparency = 1
  139. commandInfo.Size = UDim2.new(1, 0, 0.2, 0)
  140. commandInfo.Position = UDim2.new(0, 0, 0.8, 0)
  141. commandInfo.Parent = mainFrame
  142.  
  143. return screenGui, countInfo
  144. end
  145.  
  146. -- ======================
  147. -- UTILITY FUNCTIONS
  148. -- ======================
  149. local function debugPrint(message)
  150. if CONFIG.DEBUG_MODE then
  151. print("[Stand System] " .. message)
  152. end
  153. end
  154.  
  155. local function getMainPlayer()
  156. for _, player in ipairs(Players:GetPlayers()) do
  157. if player.Name == CONFIG.MAIN_USERNAME then
  158. return player
  159. end
  160. end
  161. return nil
  162. end
  163.  
  164. local function getMainCharacter()
  165. local mainPlayer = getMainPlayer()
  166. if not mainPlayer then return nil end
  167. return mainPlayer.Character
  168. end
  169.  
  170. local function getMainRoot()
  171. local mainChar = getMainCharacter()
  172. if not mainChar then return nil end
  173. return mainChar:FindFirstChild("HumanoidRootPart")
  174. end
  175.  
  176. local function getAltsInServer()
  177. local alts = {}
  178. for _, player in ipairs(Players:GetPlayers()) do
  179. if player:GetAttribute("IsStandUser") and player ~= getMainPlayer() then
  180. table.insert(alts, player)
  181. end
  182. end
  183. return alts
  184. end
  185.  
  186. local function getAltIndex()
  187. local alts = getAltsInServer()
  188. table.sort(alts, function(a, b) return a.UserId < b.UserId end)
  189.  
  190. for i, alt in ipairs(alts) do
  191. if alt == localPlayer then
  192. return i
  193. end
  194. end
  195. return 0
  196. end
  197.  
  198. local function teleportToPosition(position)
  199. local char = localPlayer.Character
  200. if not char then return end
  201.  
  202. local root = char:FindFirstChild("HumanoidRootPart")
  203. if not root then return end
  204.  
  205. root.CFrame = CFrame.new(position)
  206. end
  207.  
  208. local function teleportToCFrame(cframe)
  209. local char = localPlayer.Character
  210. if not char then return end
  211.  
  212. local root = char:FindFirstChild("HumanoidRootPart")
  213. if not root then return end
  214.  
  215. root.CFrame = cframe
  216. end
  217.  
  218. local function applyFloatingPhysics()
  219. local char = localPlayer.Character
  220. if not char then return nil, nil end
  221.  
  222. local root = char:FindFirstChild("HumanoidRootPart")
  223. if not root then return nil, nil end
  224.  
  225. -- Remove any existing physics
  226. for _, obj in ipairs(root:GetChildren()) do
  227. if obj:IsA("BodyGyro") or obj:IsA("BodyPosition") then
  228. obj:Destroy()
  229. end
  230. end
  231.  
  232. -- Create floating effect
  233. local bodyGyro = Instance.new("BodyGyro")
  234. bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
  235. bodyGyro.P = 10000
  236. bodyGyro.D = 100
  237. bodyGyro.CFrame = root.CFrame
  238. bodyGyro.Parent = root
  239.  
  240. local bodyPosition = Instance.new("BodyPosition")
  241. bodyPosition.MaxForce = Vector3.new(40000, 40000, 40000)
  242. bodyPosition.P = 10000
  243. bodyPosition.D = 100
  244. bodyPosition.Position = root.Position + Vector3.new(0, CONFIG.FLOAT_HEIGHT, 0)
  245. bodyPosition.Parent = root
  246.  
  247. return bodyGyro, bodyPosition
  248. end
  249.  
  250. -- FIXED CHAT FUNCTION USING TEXTChatService
  251. local function sendChatMessage(message)
  252. if not message or message == "" then return end
  253.  
  254. -- Use TextChatService for modern chat system
  255. if TextChatService then
  256. local channel = TextChatService.TextChannels:FindFirstChild("RBXGeneral")
  257. if channel then
  258. local success, err = pcall(function()
  259. channel:SendAsync(message)
  260. end)
  261. if not success then
  262. debugPrint("Chat error: " .. tostring(err))
  263. else
  264. debugPrint("Sent chat: " .. message)
  265. end
  266. end
  267. else
  268. -- Fallback for older chat systems
  269. local character = localPlayer.Character
  270. if character then
  271. local head = character:FindFirstChild("Head")
  272. if head then
  273. local success, err = pcall(function()
  274. game:GetService("Chat"):Chat(head, message, Enum.ChatColor.White)
  275. end)
  276. if not success then
  277. debugPrint("Chat error: " .. tostring(err))
  278. else
  279. debugPrint("Sent chat: " .. message)
  280. end
  281. end
  282. end
  283. end
  284. end
  285.  
  286. -- ======================
  287. -- COMMAND FUNCTIONS
  288. -- ======================
  289. local function teleportToMain()
  290. if STATE.isMainAccount then return end
  291.  
  292. local mainRoot = getMainRoot()
  293. if not mainRoot then return end
  294.  
  295. teleportToPosition(mainRoot.Position + Vector3.new(0, 3, 0))
  296. end
  297.  
  298. local function startFollowing()
  299. if STATE.isMainAccount then return end
  300.  
  301. STATE.isFollowing = true
  302. STATE.isFloating = false
  303.  
  304. if STATE.followThread then
  305. task.cancel(STATE.followThread)
  306. STATE.followThread = nil
  307. end
  308.  
  309. STATE.followThread = task.spawn(function()
  310. while STATE.isFollowing do
  311. local mainRoot = getMainRoot()
  312. local char = localPlayer.Character
  313. if not mainRoot or not char then
  314. task.wait(1)
  315. continue
  316. end
  317.  
  318. local root = char:FindFirstChild("HumanoidRootPart")
  319. local humanoid = char:FindFirstChildOfClass("Humanoid")
  320. if not root or not humanoid then
  321. task.wait(1)
  322. continue
  323. end
  324.  
  325. -- Calculate direction to main player
  326. local direction = (mainRoot.Position - root.Position).Unit
  327. local distance = (mainRoot.Position - root.Position).Magnitude
  328.  
  329. -- Move only if outside follow distance
  330. if distance > CONFIG.FOLLOW_DISTANCE then
  331. humanoid:MoveTo(mainRoot.Position - (direction * CONFIG.FOLLOW_DISTANCE))
  332. end
  333.  
  334. task.wait(CONFIG.FOLLOW_SPEED)
  335. end
  336. debugPrint("Follow thread ended")
  337. end)
  338. end
  339.  
  340. local function startFloating()
  341. if STATE.isMainAccount then return end
  342.  
  343. STATE.isFollowing = true
  344. STATE.isFloating = true
  345.  
  346. if STATE.followThread then
  347. task.cancel(STATE.followThread)
  348. STATE.followThread = nil
  349. end
  350.  
  351. STATE.followThread = task.spawn(function()
  352. local bodyGyro, bodyPosition = applyFloatingPhysics()
  353. if not bodyGyro or not bodyPosition then return end
  354.  
  355. debugPrint("Floating started")
  356.  
  357. while STATE.isFollowing and STATE.isFloating do
  358. local mainRoot = getMainRoot()
  359. if not mainRoot then
  360. task.wait(1)
  361. continue
  362. end
  363.  
  364. -- Calculate target position above main player
  365. bodyPosition.Position = mainRoot.Position + Vector3.new(0, CONFIG.FLOAT_HEIGHT, 0)
  366.  
  367. -- Keep character upright
  368. bodyGyro.CFrame = CFrame.new(bodyPosition.Position, bodyPosition.Position + mainRoot.CFrame.LookVector)
  369.  
  370. task.wait()
  371. end
  372.  
  373. debugPrint("Floating ended")
  374. bodyGyro:Destroy()
  375. bodyPosition:Destroy()
  376. end)
  377. end
  378.  
  379. local function startSpamming(content)
  380. if STATE.isMainAccount then return end
  381.  
  382. STATE.isSpamming = true
  383. STATE.spamContent = content
  384.  
  385. if STATE.spamThread then
  386. task.cancel(STATE.spamThread)
  387. STATE.spamThread = nil
  388. end
  389.  
  390. debugPrint("Spam started: " .. content)
  391.  
  392. STATE.spamThread = task.spawn(function()
  393. while STATE.isSpamming do
  394. sendChatMessage(STATE.spamContent)
  395.  
  396. -- Use incremental waits to allow interruption
  397. local waited = 0
  398. while waited < STATE.spamInterval and STATE.isSpamming do
  399. task.wait(0.2)
  400. waited = waited + 0.2
  401. end
  402. end
  403. debugPrint("Spam thread ended")
  404. end)
  405. end
  406.  
  407. local function startOrbiting()
  408. if STATE.isMainAccount then return end
  409.  
  410. STATE.isOrbiting = true
  411.  
  412. -- Initialize orbit angle for this alt
  413. local altIndex = getAltIndex()
  414. STATE.orbitAngles[localPlayer] = (altIndex - 1) * (2 * math.pi / STATE.standCount)
  415.  
  416. if STATE.orbitThread then
  417. task.cancel(STATE.orbitThread)
  418. STATE.orbitThread = nil
  419. end
  420.  
  421. -- Apply floating physics
  422. local bodyGyro, bodyPosition = applyFloatingPhysics()
  423. if not bodyGyro or not bodyPosition then return end
  424.  
  425. STATE.orbitThread = task.spawn(function()
  426. while STATE.isOrbiting do
  427. local mainRoot = getMainRoot()
  428. if not mainRoot then
  429. task.wait(1)
  430. continue
  431. end
  432.  
  433. -- Update orbit angle
  434. STATE.orbitAngles[localPlayer] = (STATE.orbitAngles[localPlayer] + CONFIG.ORBIT_SPEED * 0.05) % (2 * math.pi)
  435.  
  436. -- Calculate orbit position
  437. local orbitX = math.cos(STATE.orbitAngles[localPlayer]) * CONFIG.ORBIT_RADIUS
  438. local orbitZ = math.sin(STATE.orbitAngles[localPlayer]) * CONFIG.ORBIT_RADIUS
  439. local orbitPos = mainRoot.Position + Vector3.new(orbitX, CONFIG.FLOAT_HEIGHT, orbitZ)
  440.  
  441. -- Update position
  442. bodyPosition.Position = orbitPos
  443.  
  444. -- Rotate to face center
  445. bodyGyro.CFrame = CFrame.new(orbitPos, mainRoot.Position)
  446.  
  447. task.wait()
  448. end
  449.  
  450. bodyGyro:Destroy()
  451. bodyPosition:Destroy()
  452. debugPrint("Orbit thread ended")
  453. end)
  454. end
  455.  
  456. local function formLine()
  457. if STATE.isMainAccount then return end
  458.  
  459. STATE.isLinedUp = true
  460.  
  461. local altIndex = getAltIndex()
  462. if altIndex == 0 then return end
  463.  
  464. if STATE.lineThread then
  465. task.cancel(STATE.lineThread)
  466. STATE.lineThread = nil
  467. end
  468.  
  469. STATE.lineThread = task.spawn(function()
  470. while STATE.isLinedUp do
  471. local mainRoot = getMainRoot()
  472. if not mainRoot then
  473. task.wait(1)
  474. continue
  475. end
  476.  
  477. -- Calculate position in line
  478. local offset = (altIndex - 1) * CONFIG.LINE_SPACING
  479. local linePos = mainRoot.CFrame * CFrame.new(offset, 0, 0)
  480.  
  481. -- Teleport to position
  482. teleportToCFrame(linePos)
  483.  
  484. task.wait(0.5)
  485. end
  486. debugPrint("Line thread ended")
  487. end)
  488. end
  489.  
  490. local function startCounting()
  491. if STATE.isMainAccount then return end
  492.  
  493. STATE.isCounting = true
  494.  
  495. if STATE.countThread then
  496. task.cancel(STATE.countThread)
  497. STATE.countThread = nil
  498. end
  499.  
  500. STATE.countThread = task.spawn(function()
  501. local count = 1
  502. while STATE.isCounting and count <= 1000 do
  503. sendChatMessage(tostring(count))
  504. count = count + 1
  505.  
  506. -- Wait with interrupt check
  507. local waited = 0
  508. while waited < 0.5 and STATE.isCounting do
  509. task.wait(0.1)
  510. waited = waited + 0.1
  511. end
  512. end
  513. debugPrint("Count thread ended")
  514. end)
  515. end
  516.  
  517. local function startAdvancedSpamming(content)
  518. if STATE.isMainAccount then return end
  519.  
  520. STATE.isSpamming = true
  521. STATE.spamContent = content
  522.  
  523. if STATE.spamThread then
  524. task.cancel(STATE.spamThread)
  525. STATE.spamThread = nil
  526. end
  527.  
  528. debugPrint("Advanced spam started: " .. content)
  529.  
  530. STATE.spamThread = task.spawn(function()
  531. while STATE.isSpamming do
  532. -- Add random word
  533. local randomWord = ADVANCED_SPAM_WORDS[math.random(1, #ADVANCED_SPAM_WORDS)]
  534. local fullMessage = content .. " | " .. randomWord
  535.  
  536. sendChatMessage(fullMessage)
  537.  
  538. -- Random wait between 3-8 seconds
  539. local waitTime = math.random(3, 8)
  540. local waited = 0
  541. while waited < waitTime and STATE.isSpamming do
  542. task.wait(0.5)
  543. waited = waited + 0.5
  544. end
  545. end
  546. debugPrint("Advanced spam thread ended")
  547. end)
  548. end
  549.  
  550. local function startStacking()
  551. if STATE.isMainAccount then return end
  552.  
  553. STATE.isStacked = true
  554.  
  555. local altIndex = getAltIndex()
  556. if altIndex == 0 then return end
  557.  
  558. if STATE.stackThread then
  559. task.cancel(STATE.stackThread)
  560. STATE.stackThread = nil
  561. end
  562.  
  563. STATE.stackThread = task.spawn(function()
  564. while STATE.isStacked do
  565. local mainRoot = getMainRoot()
  566. if not mainRoot then
  567. task.wait(1)
  568. continue
  569. end
  570.  
  571. -- Calculate stack position
  572. local stackHeight = altIndex * CONFIG.STACK_SPACING
  573. local stackPos = mainRoot.Position + Vector3.new(0, stackHeight, 0)
  574.  
  575. -- Teleport to position
  576. teleportToPosition(stackPos)
  577.  
  578. task.wait(0.5)
  579. end
  580. debugPrint("Stack thread ended")
  581. end)
  582. end
  583.  
  584. local function formBackup()
  585. if STATE.isMainAccount then return end
  586.  
  587. STATE.isBackedUp = true
  588.  
  589. local altIndex = getAltIndex()
  590. if altIndex == 0 then return end
  591.  
  592. if STATE.backupThread then
  593. task.cancel(STATE.backupThread)
  594. STATE.backupThread = nil
  595. end
  596.  
  597. STATE.backupThread = task.spawn(function()
  598. while STATE.isBackedUp do
  599. local mainRoot = getMainRoot()
  600. if not mainRoot then
  601. task.wait(1)
  602. continue
  603. end
  604.  
  605. -- Calculate backup position
  606. local offset = (altIndex - 1) * CONFIG.BACKUP_SPACING - ((STATE.standCount - 1) * CONFIG.BACKUP_SPACING / 2)
  607. local backupPos = mainRoot.CFrame * CFrame.new(0, 0, -5) * CFrame.new(offset, 0, 0)
  608.  
  609. -- Teleport to position
  610. teleportToCFrame(backupPos)
  611.  
  612. task.wait(0.5)
  613. end
  614. debugPrint("Backup thread ended")
  615. end)
  616. end
  617.  
  618. local function startVisiting()
  619. if STATE.isMainAccount then return end
  620.  
  621. STATE.isVisiting = true
  622.  
  623. if STATE.visitThread then
  624. task.cancel(STATE.visitThread)
  625. STATE.visitThread = nil
  626. end
  627.  
  628. STATE.visitThread = task.spawn(function()
  629. while STATE.isVisiting do
  630. -- Get all players except self and main
  631. local potentialTargets = {}
  632. for _, player in ipairs(Players:GetPlayers()) do
  633. if player ~= localPlayer and player ~= getMainPlayer() and player.Character then
  634. table.insert(potentialTargets, player)
  635. end
  636. end
  637.  
  638. if #potentialTargets > 0 then
  639. -- Select random target
  640. local target = potentialTargets[math.random(1, #potentialTargets)]
  641. local targetChar = target.Character
  642. local targetRoot = targetChar and targetChar:FindFirstChild("HumanoidRootPart")
  643.  
  644. if targetRoot then
  645. -- Teleport to target
  646. teleportToPosition(targetRoot.Position + Vector3.new(0, 3, 0))
  647. end
  648. end
  649.  
  650. -- Wait with interrupt check
  651. local waited = 0
  652. while waited < CONFIG.VISIT_INTERVAL and STATE.isVisiting do
  653. task.wait(0.5)
  654. waited = waited + 0.5
  655. end
  656. end
  657. debugPrint("Visit thread ended")
  658. end)
  659. end
  660.  
  661. local function startDancing()
  662. if STATE.isMainAccount then return end
  663.  
  664. STATE.isDancing = true
  665.  
  666. if STATE.danceThread then
  667. task.cancel(STATE.danceThread)
  668. STATE.danceThread = nil
  669. end
  670.  
  671. STATE.danceThread = task.spawn(function()
  672. -- Send dance emote
  673. sendChatMessage("/e dance")
  674.  
  675. -- Keep dancing state active
  676. while STATE.isDancing do
  677. task.wait(1)
  678. end
  679. debugPrint("Dance thread ended")
  680. end)
  681. end
  682.  
  683. local function resetState()
  684. debugPrint("Resetting state...")
  685.  
  686. -- Reset all state flags
  687. STATE.isFollowing = false
  688. STATE.isFloating = false
  689. STATE.isSpamming = false
  690. STATE.isOrbiting = false
  691. STATE.isLinedUp = false
  692. STATE.isCounting = false
  693. STATE.isStacked = false
  694. STATE.isBackedUp = false
  695. STATE.isVisiting = false
  696. STATE.isDancing = false
  697. STATE.spamContent = ""
  698.  
  699. -- Cancel all threads
  700. local threads = {
  701. "followThread", "spamThread", "orbitThread", "countThread",
  702. "lineThread", "stackThread", "backupThread", "visitThread", "danceThread"
  703. }
  704.  
  705. for _, threadName in ipairs(threads) do
  706. if STATE[threadName] then
  707. task.cancel(STATE[threadName])
  708. STATE[threadName] = nil
  709. end
  710. end
  711.  
  712. -- Reset character
  713. local character = localPlayer.Character
  714. if character then
  715. local humanoid = character:FindFirstChildOfClass("Humanoid")
  716. if humanoid then
  717. humanoid:ChangeState(Enum.HumanoidStateType.Running)
  718. end
  719.  
  720. -- Remove any physics objects
  721. local root = character:FindFirstChild("HumanoidRootPart")
  722. if root then
  723. for _, obj in ipairs(root:GetChildren()) do
  724. if obj:IsA("BodyGyro") or obj:IsA("BodyPosition") then
  725. obj:Destroy()
  726. end
  727. end
  728. end
  729. end
  730.  
  731. debugPrint("Reset complete")
  732. end
  733.  
  734. -- ======================
  735. -- COMMAND PROCESSING
  736. -- ======================
  737. local function processCommand(speaker, message)
  738. if STATE.isMainAccount then return end
  739. if not speaker or speaker ~= getMainPlayer() then return end
  740.  
  741. local msg = string.lower(message)
  742.  
  743. -- Check for command prefix
  744. if string.sub(msg, 1, 1) ~= CONFIG.COMMAND_PREFIX then return end
  745.  
  746. -- Extract command and arguments
  747. local command = string.sub(msg, 2)
  748. local spaceIndex = string.find(command, " ")
  749. local cmd = command
  750. local args = ""
  751.  
  752. if spaceIndex then
  753. cmd = string.sub(command, 1, spaceIndex - 1)
  754. args = string.sub(command, spaceIndex + 1)
  755. end
  756.  
  757. debugPrint("Received command: " .. cmd .. " | Args: " .. args)
  758.  
  759. -- Process commands
  760. if cmd == "tp" then
  761. debugPrint("Executing TP command")
  762. teleportToMain()
  763.  
  764. elseif cmd == "follow" then
  765. debugPrint("Executing FOLLOW command")
  766. startFollowing()
  767.  
  768. elseif cmd == "say" then
  769. debugPrint("Executing SAY command: " .. args)
  770. sendChatMessage(args)
  771.  
  772. elseif cmd == "spam" then
  773. debugPrint("Executing SPAM command: " .. args)
  774. startSpamming(args)
  775.  
  776. elseif cmd == "stand" then
  777. debugPrint("Executing STAND command")
  778. startFloating()
  779.  
  780. elseif cmd == "reset" then
  781. debugPrint("Executing RESET command")
  782. resetState()
  783.  
  784. -- New commands
  785. elseif cmd == "orbit" then
  786. debugPrint("Executing ORBIT command")
  787. startOrbiting()
  788.  
  789. elseif cmd == "line" then
  790. debugPrint("Executing LINE command")
  791. formLine()
  792.  
  793. elseif cmd == "count" then
  794. debugPrint("Executing COUNT command")
  795. startCounting()
  796.  
  797. elseif cmd == "advancedspam" then
  798. debugPrint("Executing ADVANCEDSPAM command: " .. args)
  799. startAdvancedSpamming(args)
  800.  
  801. elseif cmd == "stack" then
  802. debugPrint("Executing STACK command")
  803. startStacking()
  804.  
  805. elseif cmd == "backup" then
  806. debugPrint("Executing BACKUP command")
  807. formBackup()
  808.  
  809. elseif cmd == "visit" then
  810. debugPrint("Executing VISIT command")
  811. startVisiting()
  812.  
  813. elseif cmd == "dance" then
  814. debugPrint("Executing DANCE command")
  815. startDancing()
  816. end
  817. end
  818.  
  819. -- ======================
  820. -- USER TRACKING
  821. -- ======================
  822. local function updateStandUsers()
  823. local standUsers = {}
  824.  
  825. for _, player in ipairs(Players:GetPlayers()) do
  826. if player:GetAttribute("IsStandUser") then
  827. table.insert(standUsers, player)
  828. end
  829. end
  830.  
  831. STATE.standUsers = standUsers
  832. STATE.standCount = #standUsers
  833.  
  834. return #standUsers
  835. end
  836.  
  837. local function identifyStandUsers()
  838. -- Identify self
  839. localPlayer:SetAttribute("IsStandUser", true)
  840. localPlayer:SetAttribute("StandRole", STATE.isMainAccount and "Main" or "Alternative")
  841.  
  842. -- Find other stand users
  843. for _, player in ipairs(Players:GetPlayers()) do
  844. if player ~= localPlayer then
  845. player:GetAttributeChangedSignal("IsStandUser"):Connect(function()
  846. updateStandUsers()
  847. end)
  848. end
  849. end
  850.  
  851. updateStandUsers()
  852. end
  853.  
  854. -- ======================
  855. -- CHAT LISTENER
  856. -- ======================
  857. local function setupChatListeners()
  858. -- Listen to all chat messages
  859. for _, player in ipairs(Players:GetPlayers()) do
  860. player.Chatted:Connect(function(message)
  861. processCommand(player, message)
  862. end)
  863. end
  864.  
  865. -- Listen for new players
  866. Players.PlayerAdded:Connect(function(player)
  867. player.Chatted:Connect(function(message)
  868. processCommand(player, message)
  869. end)
  870. end)
  871. end
  872.  
  873. -- ======================
  874. -- MAIN EXECUTION
  875. -- ======================
  876. -- Create UI
  877. local standUI, countLabel = createStandUI()
  878.  
  879. -- Identify stand users
  880. identifyStandUsers()
  881.  
  882. -- Set up chat listeners
  883. setupChatListeners()
  884.  
  885. -- Listen for new players
  886. Players.PlayerAdded:Connect(function(player)
  887. player:SetAttribute("IsStandUser", false) -- Default to non-stand user
  888.  
  889. player:GetAttributeChangedSignal("IsStandUser"):Connect(function()
  890. updateStandUsers()
  891. end)
  892. end)
  893.  
  894. -- Update UI with stand user count
  895. RunService.RenderStepped:Connect(function()
  896. countLabel.Text = "Stand Users: " .. tostring(STATE.standCount)
  897. end)
  898.  
  899. -- If main account, set up command input
  900. if STATE.isMainAccount then
  901. UserInputService.InputBegan:Connect(function(input, gameProcessed)
  902. if input.KeyCode == Enum.KeyCode.Slash and not gameProcessed then
  903. -- Open chat with prefix pre-filled
  904. game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
  905. Text = "Type commands starting with " .. CONFIG.COMMAND_PREFIX,
  906. Color = Color3.new(0.7, 0.7, 1),
  907. Font = Enum.Font.Gotham,
  908. FontSize = Enum.FontSize.Size18
  909. })
  910. end
  911. end)
  912. end
  913.  
  914. debugPrint("Stand System initialized for " .. (STATE.isMainAccount and "MAIN" or "ALTERNATIVE") .. " account")
  915. debugPrint("Listening for commands from: " .. CONFIG.MAIN_USERNAME)
Advertisement
Add Comment
Please, Sign In to add comment