can you make this whole script funciton only if specifiedPlayer said q and all of that script will stop working when specifiedPlayer says e local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local specifiedPlayer = Players:FindFirstChild("desktopitemleader")
local altPlayer1 = Players:FindFirstChild("desktopcardboard")
local altPlayer2 = Players:FindFirstChild("minidesktopspeaker")
local altPlayer3 = Players:FindFirstChild("dekstopminikey")
local altplayer4 = workspace:WaitForChild("desktopmousec")
local altplayer5 = workspace:WaitForChild("desktopremotev")

local function getPart(character, partName)
    if character then
        return character:FindFirstChild(partName)
    end
    return nil
end

-- Control variables
local spinning = false
local hovering = false

local HOVER_WALKSPEED = 30
local DEFAULT_WALKSPEED = 16
local HOVER_HIPHEIGHT = 20
local DEFAULT_HIPHEIGHT = 0

local altHRP, altHumanoid
local specifiedHRP, specifiedHumanoid

local altPlayers = { altPlayer1, altPlayer2, altPlayer3 }

local function initializeParts()
    -- Cache altPlayer1 parts
    if altPlayer1 and altPlayer1.Character then
        altHRP = getPart(altPlayer1.Character, "HumanoidRootPart")
        altHumanoid = altPlayer1.Character:FindFirstChildOfClass("Humanoid")
    else
        altHRP = nil
        altHumanoid = nil
    end
    
    -- Cache specifiedPlayer parts
    if specifiedPlayer and specifiedPlayer.Character then
        specifiedHRP = getPart(specifiedPlayer.Character, "HumanoidRootPart")
        specifiedHumanoid = specifiedPlayer.Character:FindFirstChildOfClass("Humanoid")
    else
        specifiedHRP = nil
        specifiedHumanoid = nil
    end
end

-- Respawn listeners to re-cache parts
if altPlayer1 then
    altPlayer1.CharacterAdded:Connect(function()
        wait(1)
        initializeParts()
    end)
end

if specifiedPlayer then
    specifiedPlayer.CharacterAdded:Connect(function()
        wait(1)
        initializeParts()
    end)
end

-- Helper to set PlatformStand for alt players
local function setAltPlayersPlatformStand(value)
    for _, player in pairs(altPlayers) do
        if player and player.Character then
            local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
            if humanoid then
                humanoid.PlatformStand = value
            end
        end
    end

    -- Also apply to altplayer4 and altplayer5 if they have humanoids
    for _, model in pairs({altplayer4, altplayer5}) do
        if model then
            local humanoid = model:FindFirstChildOfClass("Humanoid")
            if humanoid then
                humanoid.PlatformStand = value
            end
        end
    end
end

local function updateAltPlayer1Position()
    if altHRP and specifiedHRP then
        altHRP.CFrame = CFrame.new(specifiedHRP.Position + Vector3.new(0, 4, 0))
    end
end

local function updateAltPlayer2Head()
    if altPlayer1 and altPlayer1.Character and altPlayer2 and altPlayer2.Character then
        local alt1Head = getPart(altPlayer1.Character, "Head")
        local alt2Head = getPart(altPlayer2.Character, "Head")

        if alt1Head and alt2Head then
            local rotatedCFrame = alt1Head.CFrame * CFrame.Angles(-math.rad(90), 0, 0)
            alt2Head.CFrame = rotatedCFrame
        end
    end
end

local function updateAltPlayer3Head()
    if altPlayer1 and altPlayer1.Character and altPlayer3 and altPlayer3.Character then
        local alt1Head = getPart(altPlayer1.Character, "Head")
        local alt3Head = getPart(altPlayer3.Character, "Head")

        if alt1Head and alt3Head then
            local rotatedCFrame = alt1Head.CFrame * CFrame.Angles(math.rad(90), 0, 0)
            alt3Head.CFrame = rotatedCFrame
        end
    end
end

local function updateAltplayer4And5Heads()
    if altPlayer2 and altPlayer2.Character and altPlayer3 and altPlayer3.Character and altplayer4 and altplayer5 then
        local torso2 = getPart(altPlayer2.Character, "Torso")
        local torso3 = getPart(altPlayer3.Character, "Torso")
        local head4 = altplayer4:FindFirstChild("Head")
        local head5 = altplayer5:FindFirstChild("Head")

        if torso2 and head4 then
            head4.CFrame = torso2.CFrame * CFrame.new(0, -3, 0)
        end

        if torso3 and head5 then
            head5.CFrame = torso3.CFrame * CFrame.new(0, -3, 0)
        end
    end
end

local SPIN_SPEED = math.rad(15)
local currentRotation = 0

if specifiedPlayer then
    specifiedPlayer.Chatted:Connect(function(msg)
        local message = msg:lower()
        if message == "z" then
            spinning = true
            hovering = true
            initializeParts()
            if specifiedHumanoid then
                specifiedHumanoid.WalkSpeed = HOVER_WALKSPEED
                specifiedHumanoid.HipHeight = HOVER_HIPHEIGHT
            end
            setAltPlayersPlatformStand(false) -- Disable platform stand
        elseif message == "x" then
            spinning = false
            hovering = false
            initializeParts()
            if specifiedHumanoid then
                specifiedHumanoid.WalkSpeed = DEFAULT_WALKSPEED
                specifiedHumanoid.HipHeight = DEFAULT_HIPHEIGHT
            end
            setAltPlayersPlatformStand(true) -- Enable platform stand
            updateAltPlayer1Position()
        end
    end)
end

RunService.Heartbeat:Connect(function()
    -- Refresh cached parts 
    initializeParts()

    updateAltPlayer2Head()
    updateAltPlayer3Head()
    updateAltplayer4And5Heads()

    if hovering and specifiedHumanoid then
        specifiedHumanoid.HipHeight = HOVER_HIPHEIGHT
        specifiedHumanoid.WalkSpeed = HOVER_WALKSPEED
    elseif specifiedHumanoid then
        specifiedHumanoid.HipHeight = DEFAULT_HIPHEIGHT
        specifiedHumanoid.WalkSpeed = DEFAULT_WALKSPEED
    end

    if spinning and altHRP and specifiedHRP then
        currentRotation = currentRotation + SPIN_SPEED
        -- Position altPlayer1 at 5 studs above specifiedPlayer and spin
        local targetPos = specifiedHRP.Position + Vector3.new(0, 5, 0)
        altHRP.CFrame = CFrame.new(targetPos) * CFrame.Angles(0, currentRotation, 0)
    elseif altHRP and specifiedHRP then
        currentRotation = 0
        altHRP.CFrame = CFrame.new(specifiedHRP.Position + Vector3.new(0, 5, 0))
    end
end)

-- Initial parts cache on script start
initializeParts()