Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Enhanced Stand Script System
- -- Main account controls multiple alternative accounts via chat commands
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local TextChatService = game:GetService("TextChatService")
- local TweenService = game:GetService("TweenService")
- local HttpService = game:GetService("HttpService")
- local localPlayer = Players.LocalPlayer
- -- ======================
- -- CONFIGURATION SETTINGS
- -- ======================
- local CONFIG = {
- MAIN_USERNAME = "Gustavogus911", -- Set this to your main account's username
- COMMAND_PREFIX = "!",
- FOLLOW_DISTANCE = 5,
- FLOAT_HEIGHT = 5,
- FOLLOW_SPEED = 0.1,
- ORBIT_RADIUS = 8,
- ORBIT_SPEED = 1.5,
- LINE_SPACING = 3,
- STACK_SPACING = 3,
- BACKUP_SPACING = 4,
- VISIT_INTERVAL = 5,
- PANEL_POSITION = UDim2.new(0.5, 0, 0, 10),
- PANEL_SIZE = UDim2.new(0.3, 0, 0.15, 0),
- DEBUG_MODE = true
- }
- -- ======================
- -- STATE MANAGEMENT
- -- ======================
- local STATE = {
- isMainAccount = (localPlayer.Name == CONFIG.MAIN_USERNAME),
- isFollowing = false,
- isFloating = false,
- isSpamming = false,
- isOrbiting = false,
- isLinedUp = false,
- isCounting = false,
- isStacked = false,
- isBackedUp = false,
- isVisiting = false,
- isDancing = false,
- spamContent = "",
- spamInterval = 4,
- spamThread = nil,
- followThread = nil,
- orbitThread = nil,
- countThread = nil,
- visitThread = nil,
- danceThread = nil,
- standUsers = {},
- standCount = 0,
- orbitAngles = {}, -- Store individual orbit angles for each alt
- linePositions = {}, -- Store line positions for each alt
- stackPositions = {}, -- Store stack positions for each alt
- backupPositions = {} -- Store backup positions for each alt
- }
- -- Random words for advanced spam
- local ADVANCED_SPAM_WORDS = {"faith", "hope", "apple", "shok", "power", "light", "dark", "fire", "ice", "wind", "earth", "love", "hate", "joy", "sadness", "victory", "defeat"}
- -- ======================
- -- UI CREATION
- -- ======================
- local function createStandUI()
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "StandSystemUI"
- screenGui.Parent = localPlayer:WaitForChild("PlayerGui")
- local mainFrame = Instance.new("Frame")
- mainFrame.Name = "MainPanel"
- mainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
- mainFrame.BackgroundTransparency = 0.3
- mainFrame.BorderSizePixel = 0
- mainFrame.Position = CONFIG.PANEL_POSITION
- mainFrame.Size = CONFIG.PANEL_SIZE
- mainFrame.AnchorPoint = Vector2.new(0.5, 0)
- mainFrame.Parent = screenGui
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 8)
- corner.Parent = mainFrame
- local title = Instance.new("TextLabel")
- title.Name = "Title"
- title.Text = "STAND SYSTEM"
- title.Font = Enum.Font.GothamBold
- title.TextSize = 18
- title.TextColor3 = Color3.fromRGB(255, 255, 255)
- title.BackgroundTransparency = 1
- title.Size = UDim2.new(1, 0, 0.2, 0)
- title.Parent = mainFrame
- local userInfo = Instance.new("TextLabel")
- userInfo.Name = "UserInfo"
- userInfo.Text = "User: " .. localPlayer.Name
- userInfo.Font = Enum.Font.Gotham
- userInfo.TextSize = 14
- userInfo.TextColor3 = Color3.fromRGB(200, 200, 255)
- userInfo.BackgroundTransparency = 1
- userInfo.Size = UDim2.new(1, 0, 0.2, 0)
- userInfo.Position = UDim2.new(0, 0, 0.2, 0)
- userInfo.Parent = mainFrame
- local roleInfo = Instance.new("TextLabel")
- roleInfo.Name = "RoleInfo"
- roleInfo.Text = "Role: " .. (STATE.isMainAccount and "MAIN" or "ALTERNATIVE")
- roleInfo.Font = Enum.Font.GothamBold
- roleInfo.TextSize = 16
- roleInfo.TextColor3 = STATE.isMainAccount and Color3.fromRGB(0, 200, 0) or Color3.fromRGB(255, 150, 0)
- roleInfo.BackgroundTransparency = 1
- roleInfo.Size = UDim2.new(1, 0, 0.2, 0)
- roleInfo.Position = UDim2.new(0, 0, 0.4, 0)
- roleInfo.Parent = mainFrame
- local countInfo = Instance.new("TextLabel")
- countInfo.Name = "CountInfo"
- countInfo.Text = "Stand Users: 1"
- countInfo.Font = Enum.Font.Gotham
- countInfo.TextSize = 14
- countInfo.TextColor3 = Color3.fromRGB(255, 255, 255)
- countInfo.BackgroundTransparency = 1
- countInfo.Size = UDim2.new(1, 0, 0.2, 0)
- countInfo.Position = UDim2.new(0, 0, 0.6, 0)
- countInfo.Parent = mainFrame
- local commandInfo = Instance.new("TextLabel")
- commandInfo.Name = "CommandInfo"
- commandInfo.Text = "Prefix: " .. CONFIG.COMMAND_PREFIX
- commandInfo.Font = Enum.Font.Gotham
- commandInfo.TextSize = 12
- commandInfo.TextColor3 = Color3.fromRGB(180, 180, 180)
- commandInfo.BackgroundTransparency = 1
- commandInfo.Size = UDim2.new(1, 0, 0.2, 0)
- commandInfo.Position = UDim2.new(0, 0, 0.8, 0)
- commandInfo.Parent = mainFrame
- return screenGui, countInfo
- end
- -- ======================
- -- UTILITY FUNCTIONS
- -- ======================
- local function debugPrint(message)
- if CONFIG.DEBUG_MODE then
- print("[Stand System] " .. message)
- end
- end
- local function getMainPlayer()
- for _, player in ipairs(Players:GetPlayers()) do
- if player.Name == CONFIG.MAIN_USERNAME then
- return player
- end
- end
- return nil
- end
- local function getMainCharacter()
- local mainPlayer = getMainPlayer()
- if not mainPlayer then return nil end
- return mainPlayer.Character
- end
- local function getMainRoot()
- local mainChar = getMainCharacter()
- if not mainChar then return nil end
- return mainChar:FindFirstChild("HumanoidRootPart")
- end
- local function getAltsInServer()
- local alts = {}
- for _, player in ipairs(Players:GetPlayers()) do
- if player:GetAttribute("IsStandUser") and player ~= getMainPlayer() then
- table.insert(alts, player)
- end
- end
- return alts
- end
- local function getAltIndex()
- local alts = getAltsInServer()
- table.sort(alts, function(a, b) return a.UserId < b.UserId end)
- for i, alt in ipairs(alts) do
- if alt == localPlayer then
- return i
- end
- end
- return 0
- end
- local function teleportToPosition(position)
- local char = localPlayer.Character
- if not char then return end
- local root = char:FindFirstChild("HumanoidRootPart")
- if not root then return end
- root.CFrame = CFrame.new(position)
- end
- local function teleportToCFrame(cframe)
- local char = localPlayer.Character
- if not char then return end
- local root = char:FindFirstChild("HumanoidRootPart")
- if not root then return end
- root.CFrame = cframe
- end
- local function applyFloatingPhysics()
- local char = localPlayer.Character
- if not char then return nil, nil end
- local root = char:FindFirstChild("HumanoidRootPart")
- if not root then return nil, nil end
- -- Remove any existing physics
- for _, obj in ipairs(root:GetChildren()) do
- if obj:IsA("BodyGyro") or obj:IsA("BodyPosition") then
- obj:Destroy()
- end
- end
- -- Create floating effect
- local bodyGyro = Instance.new("BodyGyro")
- bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
- bodyGyro.P = 10000
- bodyGyro.D = 100
- bodyGyro.CFrame = root.CFrame
- bodyGyro.Parent = root
- local bodyPosition = Instance.new("BodyPosition")
- bodyPosition.MaxForce = Vector3.new(40000, 40000, 40000)
- bodyPosition.P = 10000
- bodyPosition.D = 100
- bodyPosition.Position = root.Position + Vector3.new(0, CONFIG.FLOAT_HEIGHT, 0)
- bodyPosition.Parent = root
- return bodyGyro, bodyPosition
- end
- -- FIXED CHAT FUNCTION USING TEXTChatService
- local function sendChatMessage(message)
- if not message or message == "" then return end
- -- Use TextChatService for modern chat system
- if TextChatService then
- local channel = TextChatService.TextChannels:FindFirstChild("RBXGeneral")
- if channel then
- local success, err = pcall(function()
- channel:SendAsync(message)
- end)
- if not success then
- debugPrint("Chat error: " .. tostring(err))
- else
- debugPrint("Sent chat: " .. message)
- end
- end
- else
- -- Fallback for older chat systems
- local character = localPlayer.Character
- if character then
- local head = character:FindFirstChild("Head")
- if head then
- local success, err = pcall(function()
- game:GetService("Chat"):Chat(head, message, Enum.ChatColor.White)
- end)
- if not success then
- debugPrint("Chat error: " .. tostring(err))
- else
- debugPrint("Sent chat: " .. message)
- end
- end
- end
- end
- end
- -- ======================
- -- COMMAND FUNCTIONS
- -- ======================
- local function teleportToMain()
- if STATE.isMainAccount then return end
- local mainRoot = getMainRoot()
- if not mainRoot then return end
- teleportToPosition(mainRoot.Position + Vector3.new(0, 3, 0))
- end
- local function startFollowing()
- if STATE.isMainAccount then return end
- STATE.isFollowing = true
- STATE.isFloating = false
- if STATE.followThread then
- task.cancel(STATE.followThread)
- STATE.followThread = nil
- end
- STATE.followThread = task.spawn(function()
- while STATE.isFollowing do
- local mainRoot = getMainRoot()
- local char = localPlayer.Character
- if not mainRoot or not char then
- task.wait(1)
- continue
- end
- local root = char:FindFirstChild("HumanoidRootPart")
- local humanoid = char:FindFirstChildOfClass("Humanoid")
- if not root or not humanoid then
- task.wait(1)
- continue
- end
- -- Calculate direction to main player
- local direction = (mainRoot.Position - root.Position).Unit
- local distance = (mainRoot.Position - root.Position).Magnitude
- -- Move only if outside follow distance
- if distance > CONFIG.FOLLOW_DISTANCE then
- humanoid:MoveTo(mainRoot.Position - (direction * CONFIG.FOLLOW_DISTANCE))
- end
- task.wait(CONFIG.FOLLOW_SPEED)
- end
- debugPrint("Follow thread ended")
- end)
- end
- local function startFloating()
- if STATE.isMainAccount then return end
- STATE.isFollowing = true
- STATE.isFloating = true
- if STATE.followThread then
- task.cancel(STATE.followThread)
- STATE.followThread = nil
- end
- STATE.followThread = task.spawn(function()
- local bodyGyro, bodyPosition = applyFloatingPhysics()
- if not bodyGyro or not bodyPosition then return end
- debugPrint("Floating started")
- while STATE.isFollowing and STATE.isFloating do
- local mainRoot = getMainRoot()
- if not mainRoot then
- task.wait(1)
- continue
- end
- -- Calculate target position above main player
- bodyPosition.Position = mainRoot.Position + Vector3.new(0, CONFIG.FLOAT_HEIGHT, 0)
- -- Keep character upright
- bodyGyro.CFrame = CFrame.new(bodyPosition.Position, bodyPosition.Position + mainRoot.CFrame.LookVector)
- task.wait()
- end
- debugPrint("Floating ended")
- bodyGyro:Destroy()
- bodyPosition:Destroy()
- end)
- end
- local function startSpamming(content)
- if STATE.isMainAccount then return end
- STATE.isSpamming = true
- STATE.spamContent = content
- if STATE.spamThread then
- task.cancel(STATE.spamThread)
- STATE.spamThread = nil
- end
- debugPrint("Spam started: " .. content)
- STATE.spamThread = task.spawn(function()
- while STATE.isSpamming do
- sendChatMessage(STATE.spamContent)
- -- Use incremental waits to allow interruption
- local waited = 0
- while waited < STATE.spamInterval and STATE.isSpamming do
- task.wait(0.2)
- waited = waited + 0.2
- end
- end
- debugPrint("Spam thread ended")
- end)
- end
- local function startOrbiting()
- if STATE.isMainAccount then return end
- STATE.isOrbiting = true
- -- Initialize orbit angle for this alt
- local altIndex = getAltIndex()
- STATE.orbitAngles[localPlayer] = (altIndex - 1) * (2 * math.pi / STATE.standCount)
- if STATE.orbitThread then
- task.cancel(STATE.orbitThread)
- STATE.orbitThread = nil
- end
- -- Apply floating physics
- local bodyGyro, bodyPosition = applyFloatingPhysics()
- if not bodyGyro or not bodyPosition then return end
- STATE.orbitThread = task.spawn(function()
- while STATE.isOrbiting do
- local mainRoot = getMainRoot()
- if not mainRoot then
- task.wait(1)
- continue
- end
- -- Update orbit angle
- STATE.orbitAngles[localPlayer] = (STATE.orbitAngles[localPlayer] + CONFIG.ORBIT_SPEED * 0.05) % (2 * math.pi)
- -- Calculate orbit position
- local orbitX = math.cos(STATE.orbitAngles[localPlayer]) * CONFIG.ORBIT_RADIUS
- local orbitZ = math.sin(STATE.orbitAngles[localPlayer]) * CONFIG.ORBIT_RADIUS
- local orbitPos = mainRoot.Position + Vector3.new(orbitX, CONFIG.FLOAT_HEIGHT, orbitZ)
- -- Update position
- bodyPosition.Position = orbitPos
- -- Rotate to face center
- bodyGyro.CFrame = CFrame.new(orbitPos, mainRoot.Position)
- task.wait()
- end
- bodyGyro:Destroy()
- bodyPosition:Destroy()
- debugPrint("Orbit thread ended")
- end)
- end
- local function formLine()
- if STATE.isMainAccount then return end
- STATE.isLinedUp = true
- local altIndex = getAltIndex()
- if altIndex == 0 then return end
- if STATE.lineThread then
- task.cancel(STATE.lineThread)
- STATE.lineThread = nil
- end
- STATE.lineThread = task.spawn(function()
- while STATE.isLinedUp do
- local mainRoot = getMainRoot()
- if not mainRoot then
- task.wait(1)
- continue
- end
- -- Calculate position in line
- local offset = (altIndex - 1) * CONFIG.LINE_SPACING
- local linePos = mainRoot.CFrame * CFrame.new(offset, 0, 0)
- -- Teleport to position
- teleportToCFrame(linePos)
- task.wait(0.5)
- end
- debugPrint("Line thread ended")
- end)
- end
- local function startCounting()
- if STATE.isMainAccount then return end
- STATE.isCounting = true
- if STATE.countThread then
- task.cancel(STATE.countThread)
- STATE.countThread = nil
- end
- STATE.countThread = task.spawn(function()
- local count = 1
- while STATE.isCounting and count <= 1000 do
- sendChatMessage(tostring(count))
- count = count + 1
- -- Wait with interrupt check
- local waited = 0
- while waited < 0.5 and STATE.isCounting do
- task.wait(0.1)
- waited = waited + 0.1
- end
- end
- debugPrint("Count thread ended")
- end)
- end
- local function startAdvancedSpamming(content)
- if STATE.isMainAccount then return end
- STATE.isSpamming = true
- STATE.spamContent = content
- if STATE.spamThread then
- task.cancel(STATE.spamThread)
- STATE.spamThread = nil
- end
- debugPrint("Advanced spam started: " .. content)
- STATE.spamThread = task.spawn(function()
- while STATE.isSpamming do
- -- Add random word
- local randomWord = ADVANCED_SPAM_WORDS[math.random(1, #ADVANCED_SPAM_WORDS)]
- local fullMessage = content .. " | " .. randomWord
- sendChatMessage(fullMessage)
- -- Random wait between 3-8 seconds
- local waitTime = math.random(3, 8)
- local waited = 0
- while waited < waitTime and STATE.isSpamming do
- task.wait(0.5)
- waited = waited + 0.5
- end
- end
- debugPrint("Advanced spam thread ended")
- end)
- end
- local function startStacking()
- if STATE.isMainAccount then return end
- STATE.isStacked = true
- local altIndex = getAltIndex()
- if altIndex == 0 then return end
- if STATE.stackThread then
- task.cancel(STATE.stackThread)
- STATE.stackThread = nil
- end
- STATE.stackThread = task.spawn(function()
- while STATE.isStacked do
- local mainRoot = getMainRoot()
- if not mainRoot then
- task.wait(1)
- continue
- end
- -- Calculate stack position
- local stackHeight = altIndex * CONFIG.STACK_SPACING
- local stackPos = mainRoot.Position + Vector3.new(0, stackHeight, 0)
- -- Teleport to position
- teleportToPosition(stackPos)
- task.wait(0.5)
- end
- debugPrint("Stack thread ended")
- end)
- end
- local function formBackup()
- if STATE.isMainAccount then return end
- STATE.isBackedUp = true
- local altIndex = getAltIndex()
- if altIndex == 0 then return end
- if STATE.backupThread then
- task.cancel(STATE.backupThread)
- STATE.backupThread = nil
- end
- STATE.backupThread = task.spawn(function()
- while STATE.isBackedUp do
- local mainRoot = getMainRoot()
- if not mainRoot then
- task.wait(1)
- continue
- end
- -- Calculate backup position
- local offset = (altIndex - 1) * CONFIG.BACKUP_SPACING - ((STATE.standCount - 1) * CONFIG.BACKUP_SPACING / 2)
- local backupPos = mainRoot.CFrame * CFrame.new(0, 0, -5) * CFrame.new(offset, 0, 0)
- -- Teleport to position
- teleportToCFrame(backupPos)
- task.wait(0.5)
- end
- debugPrint("Backup thread ended")
- end)
- end
- local function startVisiting()
- if STATE.isMainAccount then return end
- STATE.isVisiting = true
- if STATE.visitThread then
- task.cancel(STATE.visitThread)
- STATE.visitThread = nil
- end
- STATE.visitThread = task.spawn(function()
- while STATE.isVisiting do
- -- Get all players except self and main
- local potentialTargets = {}
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= localPlayer and player ~= getMainPlayer() and player.Character then
- table.insert(potentialTargets, player)
- end
- end
- if #potentialTargets > 0 then
- -- Select random target
- local target = potentialTargets[math.random(1, #potentialTargets)]
- local targetChar = target.Character
- local targetRoot = targetChar and targetChar:FindFirstChild("HumanoidRootPart")
- if targetRoot then
- -- Teleport to target
- teleportToPosition(targetRoot.Position + Vector3.new(0, 3, 0))
- end
- end
- -- Wait with interrupt check
- local waited = 0
- while waited < CONFIG.VISIT_INTERVAL and STATE.isVisiting do
- task.wait(0.5)
- waited = waited + 0.5
- end
- end
- debugPrint("Visit thread ended")
- end)
- end
- local function startDancing()
- if STATE.isMainAccount then return end
- STATE.isDancing = true
- if STATE.danceThread then
- task.cancel(STATE.danceThread)
- STATE.danceThread = nil
- end
- STATE.danceThread = task.spawn(function()
- -- Send dance emote
- sendChatMessage("/e dance")
- -- Keep dancing state active
- while STATE.isDancing do
- task.wait(1)
- end
- debugPrint("Dance thread ended")
- end)
- end
- local function resetState()
- debugPrint("Resetting state...")
- -- Reset all state flags
- STATE.isFollowing = false
- STATE.isFloating = false
- STATE.isSpamming = false
- STATE.isOrbiting = false
- STATE.isLinedUp = false
- STATE.isCounting = false
- STATE.isStacked = false
- STATE.isBackedUp = false
- STATE.isVisiting = false
- STATE.isDancing = false
- STATE.spamContent = ""
- -- Cancel all threads
- local threads = {
- "followThread", "spamThread", "orbitThread", "countThread",
- "lineThread", "stackThread", "backupThread", "visitThread", "danceThread"
- }
- for _, threadName in ipairs(threads) do
- if STATE[threadName] then
- task.cancel(STATE[threadName])
- STATE[threadName] = nil
- end
- end
- -- Reset character
- local character = localPlayer.Character
- if character then
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if humanoid then
- humanoid:ChangeState(Enum.HumanoidStateType.Running)
- end
- -- Remove any physics objects
- local root = character:FindFirstChild("HumanoidRootPart")
- if root then
- for _, obj in ipairs(root:GetChildren()) do
- if obj:IsA("BodyGyro") or obj:IsA("BodyPosition") then
- obj:Destroy()
- end
- end
- end
- end
- debugPrint("Reset complete")
- end
- -- ======================
- -- COMMAND PROCESSING
- -- ======================
- local function processCommand(speaker, message)
- if STATE.isMainAccount then return end
- if not speaker or speaker ~= getMainPlayer() then return end
- local msg = string.lower(message)
- -- Check for command prefix
- if string.sub(msg, 1, 1) ~= CONFIG.COMMAND_PREFIX then return end
- -- Extract command and arguments
- local command = string.sub(msg, 2)
- local spaceIndex = string.find(command, " ")
- local cmd = command
- local args = ""
- if spaceIndex then
- cmd = string.sub(command, 1, spaceIndex - 1)
- args = string.sub(command, spaceIndex + 1)
- end
- debugPrint("Received command: " .. cmd .. " | Args: " .. args)
- -- Process commands
- if cmd == "tp" then
- debugPrint("Executing TP command")
- teleportToMain()
- elseif cmd == "follow" then
- debugPrint("Executing FOLLOW command")
- startFollowing()
- elseif cmd == "say" then
- debugPrint("Executing SAY command: " .. args)
- sendChatMessage(args)
- elseif cmd == "spam" then
- debugPrint("Executing SPAM command: " .. args)
- startSpamming(args)
- elseif cmd == "stand" then
- debugPrint("Executing STAND command")
- startFloating()
- elseif cmd == "reset" then
- debugPrint("Executing RESET command")
- resetState()
- -- New commands
- elseif cmd == "orbit" then
- debugPrint("Executing ORBIT command")
- startOrbiting()
- elseif cmd == "line" then
- debugPrint("Executing LINE command")
- formLine()
- elseif cmd == "count" then
- debugPrint("Executing COUNT command")
- startCounting()
- elseif cmd == "advancedspam" then
- debugPrint("Executing ADVANCEDSPAM command: " .. args)
- startAdvancedSpamming(args)
- elseif cmd == "stack" then
- debugPrint("Executing STACK command")
- startStacking()
- elseif cmd == "backup" then
- debugPrint("Executing BACKUP command")
- formBackup()
- elseif cmd == "visit" then
- debugPrint("Executing VISIT command")
- startVisiting()
- elseif cmd == "dance" then
- debugPrint("Executing DANCE command")
- startDancing()
- end
- end
- -- ======================
- -- USER TRACKING
- -- ======================
- local function updateStandUsers()
- local standUsers = {}
- for _, player in ipairs(Players:GetPlayers()) do
- if player:GetAttribute("IsStandUser") then
- table.insert(standUsers, player)
- end
- end
- STATE.standUsers = standUsers
- STATE.standCount = #standUsers
- return #standUsers
- end
- local function identifyStandUsers()
- -- Identify self
- localPlayer:SetAttribute("IsStandUser", true)
- localPlayer:SetAttribute("StandRole", STATE.isMainAccount and "Main" or "Alternative")
- -- Find other stand users
- for _, player in ipairs(Players:GetPlayers()) do
- if player ~= localPlayer then
- player:GetAttributeChangedSignal("IsStandUser"):Connect(function()
- updateStandUsers()
- end)
- end
- end
- updateStandUsers()
- end
- -- ======================
- -- CHAT LISTENER
- -- ======================
- local function setupChatListeners()
- -- Listen to all chat messages
- for _, player in ipairs(Players:GetPlayers()) do
- player.Chatted:Connect(function(message)
- processCommand(player, message)
- end)
- end
- -- Listen for new players
- Players.PlayerAdded:Connect(function(player)
- player.Chatted:Connect(function(message)
- processCommand(player, message)
- end)
- end)
- end
- -- ======================
- -- MAIN EXECUTION
- -- ======================
- -- Create UI
- local standUI, countLabel = createStandUI()
- -- Identify stand users
- identifyStandUsers()
- -- Set up chat listeners
- setupChatListeners()
- -- Listen for new players
- Players.PlayerAdded:Connect(function(player)
- player:SetAttribute("IsStandUser", false) -- Default to non-stand user
- player:GetAttributeChangedSignal("IsStandUser"):Connect(function()
- updateStandUsers()
- end)
- end)
- -- Update UI with stand user count
- RunService.RenderStepped:Connect(function()
- countLabel.Text = "Stand Users: " .. tostring(STATE.standCount)
- end)
- -- If main account, set up command input
- if STATE.isMainAccount then
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if input.KeyCode == Enum.KeyCode.Slash and not gameProcessed then
- -- Open chat with prefix pre-filled
- game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
- Text = "Type commands starting with " .. CONFIG.COMMAND_PREFIX,
- Color = Color3.new(0.7, 0.7, 1),
- Font = Enum.Font.Gotham,
- FontSize = Enum.FontSize.Size18
- })
- end
- end)
- end
- debugPrint("Stand System initialized for " .. (STATE.isMainAccount and "MAIN" or "ALTERNATIVE") .. " account")
- debugPrint("Listening for commands from: " .. CONFIG.MAIN_USERNAME)
Advertisement
Add Comment
Please, Sign In to add comment