So, I'm trying to make a trolling GUI for people who buy admin.

When I tried I made the script inactive and then active again

Here is my code:

ChatTroll1.MouseButton1Down:Connect(function()
	local Action = game.Players:GetPlayers()
  for i = 1,#Action do
Action[i].Chatted:connect(function(Message)
  game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer("".."["..Action[i].Name.."]".." "..Message, "All")
  end)
end
ChatTroll1.MouseButton1Down:Connect(function()
	script.Active = false
	wait(0.01)
	script.Active = true
end)
end)

Here is my alternative code turning Action to nothing:

ChatTroll1.MouseButton1Down:Connect(function()
	local Action = game.Players:GetPlayers()
  for i = 1,#Action do
Action[i].Chatted:connect(function(Message)
  game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer("".."["..Action[i].Name.."]".." "..Message, "All")
  end)
end
ChatTroll1.MouseButton1Down:Connect(function()
	Action = ""
end)
end)

Error: > Players.AidanTES.PlayerGui.gui2lua #2:105: attempt to index field '?' (a nil value)