How would I make this text button disappear for everyone after someone pressed it

Hello! Am working on making a character script where if you press a button you turn in to that character. Though I only want 1 person to be able to be that person. How would I make it so after pressing the button. No one else can press it?

Script

local Player = script.Parent.Parent.Parent
local Content = script.Parent.MainFrame.Content
local Characters = game.ReplicatedStorage.Characters
local SetSubject = Characters.Parent.SetSubject

script.Parent.MainFrame.Visible = true

for index,item in pairs(Characters:GetChildren()) do
	if item:FindFirstChild("Humanoid") then
		local ViewportFrame = Instance.new("ViewportFrame")
		ViewportFrame.Parent = Content
		ViewportFrame.BackgroundTransparency = 1

		local Button = Instance.new("TextButton")
		Button.Parent = ViewportFrame
		Button.Position = UDim2.new(0,0,1,0)
		Button.Size = UDim2.new(1,0,0,25)
		Button.BorderSizePixel = 0
		Button.BackgroundColor3 = Color3.fromRGB(255,255,255)
		Button.TextScaled = true

		local Preview = item:Clone()
		Preview.Parent = ViewportFrame
		Button.Text = "Play As "..Preview.Name

		local Camera = Instance.new("Camera")
		Camera.Parent = ViewportFrame
		Camera.CFrame = Preview.Head.CFrame + Preview.Head.CFrame.LookVector * 5
		Camera.CFrame = CFrame.new(Camera.CFrame.Position,Preview.Head.Position)

		ViewportFrame.CurrentCamera = Camera

		Button.MouseButton1Down:Connect(function()
			game.ReplicatedStorage.CharacterTaken:FireAllClients()
			Button:Destroy()
			script.Parent.Enabled = false
			local ChosenCharacter = item:Clone()
			local CurrentCharacter = Player.Character
			local LocalScripts = {}

			for index2,item2 in pairs(game.StarterPlayer.StarterCharacterScripts:GetChildren()) do
				if item2:IsA('LocalScript') then
					table.insert(LocalScripts,item2:Clone())
				else
					item2:Clone().Parent = ChosenCharacter
				end
			end

			CurrentCharacter.Health:Clone().Parent = ChosenCharacter
			ChosenCharacter.Name = Player.Name
			table.insert(LocalScripts,CurrentCharacter.Animate:Clone())
			ChosenCharacter.Parent = workspace
			Player.Character = ChosenCharacter
			for index2,item2 in pairs(LocalScripts) do
				item2.Parent = ChosenCharacter
			end 
			SetSubject:FireClient(Player,ChosenCharacter.Humanoid)

			local Connection

			local function onDied()
				wait(game.Players.RespawnTime)
				Player:LoadCharacter()
				script.Parent.Enabled = true
				if Connection then
					Connection:Disconnect()
				end
			end

			Connection = ChosenCharacter.Humanoid.Died:Connect(onDied)

		end)

	end
end

localscript

game.ReplicatedStorage.CharacterTaken.OnClientEvent:Connect(function(Button)
	Button:Destroy()
end)

You can use a remote event when the button is pressed to send a signal to the server which tells it to destroy the gui (destroying on the server instead of the client ensures it removes for all clients).

You can use a cooldown.

local debounce = true

Button.MouseButton1Down:Connect(function()
    if debounce == true then debounce = false
    -- do stuff
    end
end)

I see a problem. In your MouseButton1Down, you already have Button:Destroy() and in your OnClientEvent, you did Button:Destroy() again. If it’s the same button, it will throw an error because it can’t find the button that’s already destroyed.

You didn’t send anything inside the parameter but you have something in your localscript:

game.ReplicatedStorage.CharacterTaken.OnClientEvent:Connect(function(Button)

You might not need to do it on the client’s side because if you are able to destroy the button on the server side, the client will see it disappeared, too.

Sorry for the weird variables, was meant for something else:

ServerScript:

local IsTouched = game.ReplicatedStorage.IsTouched -- Add a BoolValue, Name it whatever
IsTouched .Value = true

Button.Activated:Connect(function()
if IsTouched == true then
IsTouched = false
end
end)

LocalScript:

game.ReplicatedStorage.IsTouched:GetPropertyChangedSignal("Value"):Connect(function()
Button.Visible = false
end)

(Changes on all players games due to the first script being on the Server, plus the BoolValue)

the thing is that. there is 3 characters. so if i deleted from the script. it would delete every character